[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

RE: [XaraXtreme-dev] Font metrics and kerning update



In message <5056CBC646CB4047BB26120F4377DB71CB74FD@xxxxxxxxxxxxxxxxxxx  
        "Gerry Iles" <GerryI@xxxxxxxx> wrote:
>> Martin Wuerthner wrote:
> In message <5056CBC646CB4047BB26120F4377DB71CB74EC@xxxxxxxxxxxxxxxxxxx
>           "Gerry Iles" <GerryI@xxxxxxxx> wrote:
> 
>> I'm getting the following error trying to build the latest code...
>> 
>> ftfonts.cpp: In static member function 'static OUTLINETEXTMETRIC*
>> FTFontMan::GetOutlineTextMetric(LOGFONT*)':
>> ftfonts.cpp:1056: error: 'FT_Sfnt_Table_Info' was not declared in this
>> scope
>> 
>> Any ideas anyone...?
> 
> What does
>   freetype-config --ftversion
> display?
>
>> Well --ftversion doesn't work but --version gives 9.7.3

Ah, that explains it. --ftversion was added in the same release as the 
FT_Sfnt_Table_Info call was added. That was version 2.1.10 by the way, 
released in June 2005. You seem to have an earlier version.

So, we should either check for version 2.1.10 or higher in Makefile.am 
or, probably better, I can work around this call, so it should work 
with earlier versions of FreeType 2 as well. Find attached below a 
patch that removes the dependency on the FT_Sfnt_Table_Info call.

Martin
Index: wxOil/ftfonts.cpp
===================================================================
--- wxOil/ftfonts.cpp	(Revision 849)
+++ wxOil/ftfonts.cpp	(Arbeitskopie)
@@ -1045,16 +1045,12 @@
 
 	// first of all, retrieve the underlying font information
 	if (!GetPangoFcFontAndFreeTypeFaceForFaceName(pFaceName, &pPangoFcFont, &pFreeTypeFace)) return NULL;
+	// we have successfully retrieved the FreeType information (we need to release it below!)
 
-	// we have successfully retrieved the FreeType information - we need to release the information below
-	// ask FreeType for the Panose information
-	FT_ULong DummyTag;
-	FT_ULong DummyLen;
-
-	// check whether this font has a TrueType OS/2 font table
+	// ask FreeType for the Panose information - this is found in the OS/2 font table,
+	// so check whether this font has a TrueType OS/2 font table
 	TT_OS2* pOS2_Table;
-	if (FT_Sfnt_Table_Info(pFreeTypeFace, ft_sfnt_os2, &DummyTag, &DummyLen) != 0 /* not present */
-		|| (pOS2_Table = (TT_OS2*)FT_Get_Sfnt_Table(pFreeTypeFace, ft_sfnt_os2)) == NULL   /* error loading */
+	if ((pOS2_Table = (TT_OS2*)FT_Get_Sfnt_Table(pFreeTypeFace, ft_sfnt_os2)) == NULL   /* error loading */
 		|| pOS2_Table->version == 0xffff /* Mac font without OS/2 table */)
 	{
 		// we could not get the table with the Panose information, either because there