[futurebasic] Re: [FB] FontFamily etc.

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2002 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Sat, 14 Dec 2002 18:45:13 +1300
On Saturday, December 14, 2002, at 02:13  PM, Robert Covington wrote:

> I have CarbonLib in some modern incarnation 1.4+, but even when 
> including
> Toolbx Fonts Include, I get a missing toolbox message at program 
> startup
> (the crash warning, missing from this machine) for
>
> FMGetFontFamilyFromName
>
> even though Apple docs say available since Carbonlib v1.0?


You would get the "Missing toolbox" message if you compiled in PPC, 
because FMGetFontFamilyFromName (and other routines in Tlbx Fonts.Incl) 
need to be imported from the FontManager library in a non-Carbon 
application.

The header Tlbx Fonts.Incl is slightly defective in that it does not 
automatically point itself at the library.
You can get things to work, in both PPC and Carbon, like this:



'~'A
'                       Runtime : RNTM Lite.INCL
'~'B

#if CarbonLib == 0
library "FontManager" // library declaration missing from Tlbx 
Fonts.Incl
#endif
include "Tlbx Fonts.Incl"
library

dim fontID as FMFontFamily
fontID = Fn FMGetFontFamilyFromName( "Geneva" )
print fontID



Robert P.