|
Mac OS 9
|
Public interface to the Font Manager. More...
#include <MacTypes.h>#include <ATSTypes.h>#include <Files.h>#include <MacErrors.h>#include <Quickdraw.h>#include <TextCommon.h>Go to the source code of this file.
Data Structures | |
| struct | FMInput |
| struct | FMOutput |
| struct | FMetricRec |
| struct | WidEntry |
| struct | WidTable |
| struct | AsscEntry |
| struct | FontAssoc |
| struct | StyleTable |
| struct | NameTable |
| struct | KernPair |
| struct | KernEntry |
| struct | KernTable |
| struct | WidthTable |
| struct | FamRec |
| struct | FontRec |
Typedefs | |
| typedef struct FMInput | FMInput |
| typedef struct FMOutput | FMOutput |
| typedef FMOutput * | FMOutputPtr |
| typedef FMOutputPtr | FMOutPtr |
| typedef struct FMetricRec | FMetricRec |
| typedef FMetricRec * | FMetricRecPtr |
| typedef FMetricRecPtr * | FMetricRecHandle |
| typedef FMFontFamily | FontFamilyID |
| typedef FMFontSize | FontPointSize |
| typedef struct WidEntry | WidEntry |
| typedef struct WidTable | WidTable |
| typedef struct AsscEntry | AsscEntry |
| typedef struct FontAssoc | FontAssoc |
| typedef struct StyleTable | StyleTable |
| typedef struct NameTable | NameTable |
| typedef struct KernPair | KernPair |
| typedef struct KernEntry | KernEntry |
| typedef struct KernTable | KernTable |
| typedef struct WidthTable | WidthTable |
| typedef WidthTable * | WidthTablePtr |
| typedef WidthTablePtr * | WidthTableHdl |
| typedef struct FamRec | FamRec |
| typedef struct FontRec | FontRec |
| typedef FontRec * | FontRecPtr |
| typedef FontRecPtr * | FontRecHdl |
Functions | |
| void | InitFonts (void) |
| void | GetFontName (short familyID, Str255 name) |
| void | GetFNum (ConstStr255Param name, short *familyID) |
| Boolean | RealFont (short fontNum, short size) |
| void | SetFontLock (Boolean lockFlag) |
| FMOutPtr | FMSwapFont (const FMInput *inRec) |
| void | SetFScaleDisable (Boolean fscaleDisable) |
| void | FontMetrics (FMetricRecPtr theMetrics) |
| void | SetFractEnable (Boolean fractEnable) |
| Enable/disable use of fractional character widths. More... | |
| short | GetDefFontSize (void) |
| Retrieve the size of the current default font. More... | |
| Boolean | IsOutline (Point numer, Point denom) |
| void | SetOutlinePreferred (Boolean outlinePreferred) |
| SetOutlinePreferred Make TrueType fonts preferred over bitmapped fonts. More... | |
| Boolean | GetOutlinePreferred (void) |
| GetOutlinePreferred Determine if TrueType fonts are preferred. More... | |
| OSErr | OutlineMetrics (short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray) |
| void | SetPreserveGlyph (Boolean preserveGlyph) |
| SetPreserveGlyph Set whether to preserve outline glyph shape. More... | |
| Boolean | GetPreserveGlyph (void) |
| GetPreserveGlyph Find whether TrueType glyph shape is preserved or. More... | |
| OSErr | FlushFonts (void) |
| void | getfnum (const char *theName, short *familyID) |
| void | getfontname (short familyID, char *theName) |
| short | GetSysFont (void) |
| Fetch the ID of the current system font. More... | |
| short | GetAppFont (void) |
| Fetch the ID of the current application font. More... | |
| OSStatus | SetAntiAliasedTextEnabled (Boolean iEnable, SInt16 iMinFontSize) |
| Boolean | IsAntiAliasedTextEnabled (SInt16 *oMinFontSize) |
| void | QDTextBounds (short byteCount, const void *textAddr, Rect *bounds) |
| OSErr | FetchFontInfo (SInt16 fontID, SInt16 fontSize, SInt16 fontStyle, FontInfo *info) |
| OSStatus | FMCreateFontFamilyIterator (const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontFamilyIterator *ioIterator) |
| OSStatus | FMDisposeFontFamilyIterator (FMFontFamilyIterator *ioIterator) |
| OSStatus | FMResetFontFamilyIterator (const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontFamilyIterator *ioIterator) |
| OSStatus | FMGetNextFontFamily (FMFontFamilyIterator *ioIterator, FMFontFamily *oFontFamily) |
| OSStatus | FMCreateFontIterator (const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontIterator *ioIterator) |
| OSStatus | FMDisposeFontIterator (FMFontIterator *ioIterator) |
| OSStatus | FMResetFontIterator (const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontIterator *ioIterator) |
| OSStatus | FMGetNextFont (FMFontIterator *ioIterator, FMFont *oFont) |
| OSStatus | FMCreateFontFamilyInstanceIterator (FMFontFamily iFontFamily, FMFontFamilyInstanceIterator *ioIterator) |
| OSStatus | FMDisposeFontFamilyInstanceIterator (FMFontFamilyInstanceIterator *ioIterator) |
| OSStatus | FMResetFontFamilyInstanceIterator (FMFontFamily iFontFamily, FMFontFamilyInstanceIterator *ioIterator) |
| OSStatus | FMGetNextFontFamilyInstance (FMFontFamilyInstanceIterator *ioIterator, FMFont *oFont, FMFontStyle *oStyle, FMFontSize *oSize) |
| FMFontFamily | FMGetFontFamilyFromName (ConstStr255Param iName) |
| OSStatus | FMGetFontFamilyName (FMFontFamily iFontFamily, Str255 oName) |
| OSStatus | FMGetFontFamilyTextEncoding (FMFontFamily iFontFamily, TextEncoding *oTextEncoding) |
| OSStatus | FMGetFontFamilyGeneration (FMFontFamily iFontFamily, FMGeneration *oGeneration) |
| OSStatus | FMGetFontFormat (FMFont iFont, FourCharCode *oFormat) |
| OSStatus | FMGetFontTableDirectory (FMFont iFont, ByteCount iLength, void *iBuffer, ByteCount *oActualLength) |
| OSStatus | FMGetFontTable (FMFont iFont, FourCharCode iTag, ByteOffset iOffset, ByteCount iLength, void *iBuffer, ByteCount *oActualLength) |
| OSStatus | FMGetFontGeneration (FMFont iFont, FMGeneration *oGeneration) |
| OSStatus | FMGetFontContainer (FMFont iFont, FSSpec *oFontContainer) |
| OSStatus | FMGetFontFromFontFamilyInstance (FMFontFamily iFontFamily, FMFontStyle iStyle, FMFont *oFont, FMFontStyle *oIntrinsicStyle) |
| OSStatus | FMGetFontFamilyInstanceFromFont (FMFont iFont, FMFontFamily *oFontFamily, FMFontStyle *oStyle) |
| ATSFontRef | FMGetATSFontRefFromFont (FMFont iFont) |
| ATSFontFamilyRef | FMGetATSFontFamilyRefFromFontFamily (FMFontFamily iFamily) |
| FMFont | FMGetFontFromATSFontRef (ATSFontRef iFont) |
| FMFontFamily | FMGetFontFamilyFromATSFontFamilyRef (ATSFontFamilyRef iFamily) |
| OSStatus | FMActivateFonts (const FSSpec *iFontContainer, const FMFilter *iFilter, void *iRefCon, OptionBits iOptions) |
| OSStatus | FMDeactivateFonts (const FSSpec *iFontContainer, const FMFilter *iFilter, void *iRefCon, OptionBits iOptions) |
| FMGeneration | FMGetGeneration (void) |
| OSStatus | FMGetFontContainerFromFontFamilyInstance (FMFontFamily iFontFamily, FMFontStyle iStyle, FMFontSize iFontSize, FSSpec *oFontContainer) |
| OSStatus | FMGetFontFamilyResource (FMFontFamily iFontFamily, FMFontStyle iFontStyle, FMFontSize iFontSize, ByteCount iBufferSize, void *ioBuffer, ByteCount *oSize) |
Variables | |
| * | don |
| athens = kFontIDAthens | |
| sanFran = kFontIDSanFrancisco | |
| toronto = kFontIDToronto | |
| cairo = kFontIDCairo | |
| losAngeles = kFontIDLosAngeles | |
| times = kFontIDTimes | |
| helvetica = kFontIDHelvetica | |
| courier = kFontIDCourier | |
| symbol = kFontIDSymbol | |
| mobile | |
Public interface to the Font Manager.
| typedef FMFontFamily FontFamilyID |
can be NULL
| anonymous enum |
Activation contexts
| anonymous enum |
Iteration scopes
| anonymous enum |
kPlatformDefaultGuiFontID is used in QuickTime 3.0.
| anonymous enum |
TARGET_OS_MAC
| anonymous enum |
Deprecated constant and type definitions
The font identifier constants are deprecated; use GetFNum or FMGetFontFamilyFromName to find a font family from a standard QuickDraw name.
| OSErr FetchFontInfo | ( | SInt16 | fontID, |
| SInt16 | fontSize, | ||
| SInt16 | fontStyle, | ||
| FontInfo * | info | ||
| ) |
| OSErr FlushFonts | ( | void | ) |
| OSStatus FMActivateFonts | ( | const FSSpec * | iFontContainer, |
| const FMFilter * | iFilter, | ||
| void * | iRefCon, | ||
| OptionBits | iOptions | ||
| ) |
Activation FMActivateFonts()
| iRefCon | can be NULL |
| OSStatus FMCreateFontFamilyInstanceIterator | ( | FMFontFamily | iFontFamily, |
| FMFontFamilyInstanceIterator * | ioIterator | ||
| ) |
Font families FMCreateFontFamilyInstanceIterator()
| OSStatus FMCreateFontFamilyIterator | ( | const FMFilter * | iFilter, |
| void * | iRefCon, | ||
| OptionBits | iOptions, | ||
| FMFontFamilyIterator * | ioIterator | ||
| ) |
Font access and data management functions (available only with Mac OS 9.0 or later)
Enumeration FMCreateFontFamilyIterator()
| iRefCon | can be NULL |
| OSStatus FMCreateFontIterator | ( | const FMFilter * | iFilter, |
| void * | iRefCon, | ||
| OptionBits | iOptions, | ||
| FMFontIterator * | ioIterator | ||
| ) |
| iRefCon | can be NULL |
| OSStatus FMDeactivateFonts | ( | const FSSpec * | iFontContainer, |
| const FMFilter * | iFilter, | ||
| void * | iRefCon, | ||
| OptionBits | iOptions | ||
| ) |
| iRefCon | can be NULL |
| OSStatus FMDisposeFontFamilyInstanceIterator | ( | FMFontFamilyInstanceIterator * | ioIterator | ) |
FMDisposeFontFamilyInstanceIterator()
| OSStatus FMDisposeFontFamilyIterator | ( | FMFontFamilyIterator * | ioIterator | ) |
| OSStatus FMDisposeFontIterator | ( | FMFontIterator * | ioIterator | ) |
| ATSFontFamilyRef FMGetATSFontFamilyRefFromFontFamily | ( | FMFontFamily | iFamily | ) |
FMGetATSFontFamilyRefFromFontFamily()
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
| ATSFontRef FMGetATSFontRefFromFont | ( | FMFont | iFont | ) |
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
| OSStatus FMGetFontContainer | ( | FMFont | iFont, |
| FSSpec * | oFontContainer | ||
| ) |
| OSStatus FMGetFontContainerFromFontFamilyInstance | ( | FMFontFamily | iFontFamily, |
| FMFontStyle | iStyle, | ||
| FMFontSize | iFontSize, | ||
| FSSpec * | oFontContainer | ||
| ) |
Container Access FMGetFontContainerFromFontFamilyInstance()
| FMFontFamily FMGetFontFamilyFromATSFontFamilyRef | ( | ATSFontFamilyRef | iFamily | ) |
FMGetFontFamilyFromATSFontFamilyRef()
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
| FMFontFamily FMGetFontFamilyFromName | ( | ConstStr255Param | iName | ) |
can be NULL FMGetFontFamilyFromName()
| OSStatus FMGetFontFamilyGeneration | ( | FMFontFamily | iFontFamily, |
| FMGeneration * | oGeneration | ||
| ) |
| OSStatus FMGetFontFamilyInstanceFromFont | ( | FMFont | iFont, |
| FMFontFamily * | oFontFamily, | ||
| FMFontStyle * | oStyle | ||
| ) |
can be NULL FMGetFontFamilyInstanceFromFont()
| OSStatus FMGetFontFamilyName | ( | FMFontFamily | iFontFamily, |
| Str255 | oName | ||
| ) |
| OSStatus FMGetFontFamilyResource | ( | FMFontFamily | iFontFamily, |
| FMFontStyle | iFontStyle, | ||
| FMFontSize | iFontSize, | ||
| ByteCount | iBufferSize, | ||
| void * | ioBuffer, | ||
| ByteCount * | oSize | ||
| ) |
| OSStatus FMGetFontFamilyTextEncoding | ( | FMFontFamily | iFontFamily, |
| TextEncoding * | oTextEncoding | ||
| ) |
| OSStatus FMGetFontFormat | ( | FMFont | iFont, |
| FourCharCode * | oFormat | ||
| ) |
Fonts FMGetFontFormat()
| FMFont FMGetFontFromATSFontRef | ( | ATSFontRef | iFont | ) |
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
| OSStatus FMGetFontFromFontFamilyInstance | ( | FMFontFamily | iFontFamily, |
| FMFontStyle | iStyle, | ||
| FMFont * | oFont, | ||
| FMFontStyle * | oIntrinsicStyle | ||
| ) |
Conversion FMGetFontFromFontFamilyInstance()
| OSStatus FMGetFontGeneration | ( | FMFont | iFont, |
| FMGeneration * | oGeneration | ||
| ) |
can be NULL FMGetFontGeneration()
| OSStatus FMGetFontTable | ( | FMFont | iFont, |
| FourCharCode | iTag, | ||
| ByteOffset | iOffset, | ||
| ByteCount | iLength, | ||
| void * | iBuffer, | ||
| ByteCount * | oActualLength | ||
| ) |
can be NULL FMGetFontTable()
| OSStatus FMGetFontTableDirectory | ( | FMFont | iFont, |
| ByteCount | iLength, | ||
| void * | iBuffer, | ||
| ByteCount * | oActualLength | ||
| ) |
| FMGeneration FMGetGeneration | ( | void | ) |
| OSStatus FMGetNextFont | ( | FMFontIterator * | ioIterator, |
| FMFont * | oFont | ||
| ) |
| OSStatus FMGetNextFontFamily | ( | FMFontFamilyIterator * | ioIterator, |
| FMFontFamily * | oFontFamily | ||
| ) |
| OSStatus FMGetNextFontFamilyInstance | ( | FMFontFamilyInstanceIterator * | ioIterator, |
| FMFont * | oFont, | ||
| FMFontStyle * | oStyle, | ||
| FMFontSize * | oSize | ||
| ) |
| oSize | can be NULL |
| OSStatus FMResetFontFamilyInstanceIterator | ( | FMFontFamily | iFontFamily, |
| FMFontFamilyInstanceIterator * | ioIterator | ||
| ) |
FMResetFontFamilyInstanceIterator()
| OSStatus FMResetFontFamilyIterator | ( | const FMFilter * | iFilter, |
| void * | iRefCon, | ||
| OptionBits | iOptions, | ||
| FMFontFamilyIterator * | ioIterator | ||
| ) |
| iRefCon | can be NULL |
| OSStatus FMResetFontIterator | ( | const FMFilter * | iFilter, |
| void * | iRefCon, | ||
| OptionBits | iOptions, | ||
| FMFontIterator * | ioIterator | ||
| ) |
| iRefCon | can be NULL |
CALL_NOT_IN_CARBON FMSwapFont()
| void FontMetrics | ( | FMetricRecPtr | theMetrics | ) |
| short GetAppFont | ( | void | ) |
Fetch the ID of the current application font.
GetAppFont gets the ID of the current application font.
This routine is in the Pascal interface, not ROM and can't be used with the 64K ROM.
| short GetDefFontSize | ( | void | ) |
Retrieve the size of the current default font.
GetDefFontSize gets the size of the current default font.
This routine is in the Pascal interface, not ROM and can't be used with the 64K ROM.
| void getfnum | ( | const char * | theName, |
| short * | familyID | ||
| ) |
CALL_NOT_IN_CARBON getfnum()
| void GetFNum | ( | ConstStr255Param | name, |
| short * | familyID | ||
| ) |
| void getfontname | ( | short | familyID, |
| char * | theName | ||
| ) |
| void GetFontName | ( | short | familyID, |
| Str255 | name | ||
| ) |
CALL_NOT_IN_CARBON GetFontName()
| Boolean GetOutlinePreferred | ( | void | ) |
GetOutlinePreferred Determine if TrueType fonts are preferred.
You can use the GetOutlinePreferred function to determine whether or not TrueType fonts are preferred over bitmapped fonts . If both types of fonts are available for a particular font request, the GetOutlinePreferred function returns a Boolean value indicating whether the Font Manager chooses TrueType fonts over bitmapped fonts. By default, the Font Manager prefers to use bitmapped fonts, for which the GetOutlinePreferred function returns FALSE; you can also set the behavior of the Font Manager with the SetOutlinePreferred procedure.
TRUE = TrueType is preferred FALSE = bitmapped fonts preferred
| Boolean GetPreserveGlyph | ( | void | ) |
GetPreserveGlyph Find whether TrueType glyph shape is preserved or.
The GetPreserveGlyph function returns a Boolean value indicating whether the Font Manager preserves the shape of TrueType glyphs, which by default is FALSE. Your application can set the behavior of the Font Manager using the SetPreserveGlyph procedure.
Boolean TRUE = does preserve TrueType glyph shape FALSE = does not preserve TrueType glyph shape
| short GetSysFont | ( | void | ) |
Fetch the ID of the current system font.
CALL_NOT_IN_CARBON
GetSysFont gets the ID of the current system font.
This routine is in the Pascal interface, not ROM and can't be used with the 64K ROM.
| void InitFonts | ( | void | ) |
| Boolean IsAntiAliasedTextEnabled | ( | SInt16 * | oMinFontSize | ) |
| OSErr OutlineMetrics | ( | short | byteCount, |
| const void * | textPtr, | ||
| Point | numer, | ||
| Point | denom, | ||
| short * | yMax, | ||
| short * | yMin, | ||
| FixedPtr | awArray, | ||
| FixedPtr | lsbArray, | ||
| RectPtr | boundsArray | ||
| ) |
| void QDTextBounds | ( | short | byteCount, |
| const void * | textAddr, | ||
| Rect * | bounds | ||
| ) |
| Boolean RealFont | ( | short | fontNum, |
| short | size | ||
| ) |
| OSStatus SetAntiAliasedTextEnabled | ( | Boolean | iEnable, |
| SInt16 | iMinFontSize | ||
| ) |
Extended font data functions (available only with Mac OS 8.5 or later)
| void SetFontLock | ( | Boolean | lockFlag | ) |
| void SetFractEnable | ( | Boolean | fractEnable | ) |
Enable/disable use of fractional character widths.
SetFractEnable controls the use of fractional character widths for drawing text. By default, fractional widths are disabled. useFract is a Boolean specifying whether to enable or disable use of fractional character widths. It is one of: FALSEDisable. All sizes are rounded to integers. TRUEEnable. Use fixed-point calculations in all operations that determine character placement.
none
SetFractEnable affects functions that draw text (such as DrawString ), and functions that calculate character widths (such as TextWidth , CharWidth , and MeasureText ). The 64K ROMs do not support fractional character widths; so all characters are sized in typographical points (increments of 1/72nd of an inch). Use SetFractEnable (TRUE) before printing to the laser printer or other high-resolution device or when writing in a "page-preview" window. At other times, leave fractional positioning off for faster calculations. C and ASM programmers are advised to use this routine rather than bypassing it by setting the byte-length global variable FractEnable (at 0x0BF4) to 0xFF ( TRUE) or 0x00 ( FALSE). Note: Be sure you're running on the 128K ROMs or later (see Gestalt).
| void SetFScaleDisable | ( | Boolean | fscaleDisable | ) |
| void SetOutlinePreferred | ( | Boolean | outlinePreferred | ) |
SetOutlinePreferred Make TrueType fonts preferred over bitmapped fonts.
You can use the SetOutlinePreferred procedure to cause the Font Manager to prefer TrueType fonts over bitmapped fonts . If a TrueType font and a bitmapped font are available for a font request, the default behavior for the Font Manager is to choose the bitmapped font, in order to maintain compatibility with documents that were created on computer systems on which TrueType fonts were not available. The SetOutlinePreferred procedure sets the preference of which type of font to use in this situation. If you want the Font Manager to choose outline fonts over any bitmapped font counterparts, set the outlinePreferred parameter to TRUE. If only outline fonts are available and outlinePreferred is set to FALSE, the outline font is chosen regardless. If only bitmapped fonts are available and outlinePreferred is set to TRUE, the bitmapped font is still chosen.
none
| void SetPreserveGlyph | ( | Boolean | preserveGlyph | ) |
SetPreserveGlyph Set whether to preserve outline glyph shape.
The SetPreserveGlyph procedure tells the Font Manager whether to preserve the original shape of an outline glyph, which in some cases may exceed the ascent or descent lines. The default behavior for the Font Manager is to scale a glyph so that it fits between the ascent and descent lines; however, this alters the look of the glyph. If you set the preserveGlyph parameter in the SetPreserveGlyph procedure to TRUE, the measurements of all glyphs are preserved, and your application may have to alter the leading between lines in a document if some of these glyphs extend beyond the ascent or descent lines. If you set preserveGlyph to FALSE, all glyphs are scaled to fit between the ascent and descent lines. Save the setting of whether glyphs are preserved or not and call SetPreserveGlyph with this value as the parameter every time the user opens the application.
none
| * don |
OLDROUTINENAMES
FONTS
| mobile |