A function identified as deprecated has been superseded and may become unsupported in the future.
Obtains the information for a specific font. (Deprecated in Mac OS X v10.4. There is no replacement function.)
OSErr FetchFontInfo ( SInt16 fontID, SInt16 fontSize, SInt16 fontStyle, FontInfo *info );
A signed, 16-bit integer that specifies the font ID of the font whose information you want to obtain.
A signed, 16-bit integer that specifies the font size of the font whose information you want to obtain.
A signed, 16-bit integer that specifies the font style of the font whose information you want to obtain.
On output, points to a font information structure that contains measurement information (ascent, descent, width, and leading) for the specified font.
A result code. See “Font Manager Result Codes.”
Fonts.h
Activates one or more fonts. (Deprecated in Mac OS X v10.4. Use ATSFontActivateFromFileReference
instead.)
OSStatus FMActivateFonts ( const FSSpec *iFontContainer, const FMFilter *iFilter, void *iRefCon, OptionBits iOptions );
A pointer to the file specification of the file that contains the font data you want to activate. You can specify a directory or an individual font file.
A pointer to a filter specification. This parameter is currently reserved for future use, so you should pass NULL
.
An arbitrary 32-bit value specified by your application. This parameter is currently reserved for future use, so you should pass NULL
.
A value that specifies the scope to which the function applies. If you want the Font Manager to make the fonts visible only to your application, use the constant kFMLocalActivationContext
. If you want the Font Manager to make fonts visible to all applications installed on the system, use the constant kFMGlobalActivationContext
. See Activation Contexts for more information on these constants.
A result code. See “Font Manager Result Codes.”
Fonts.h
Creates a font family instance iterator that your application can use to access the member fonts associated with a font family. (Deprecated in Mac OS X v10.4.)
OSStatus FMCreateFontFamilyInstanceIterator ( FMFontFamily iFontFamily, FMFontFamilyInstanceIterator *ioIterator );
A reference to the font family you want to access.
A pointer to a structure of type FMFontFamilyInstanceIterator
. On input, pass a pointer to an uninitialized structure. On output, its contents may have been changed and may include references to other data structures allocated by the system to maintain the structure’s state. The iterator is positioned before the first member font of the font family. When you no longer need the font family instance iterator, you should call the function FMDisposeFontFamilyInstanceIterator
to release the auxiliary data and memory allocated by the system.
A result code. See “Font Manager Result Codes.”
A font family instance iterator is an opaque data structure used by the Font Manager to keep track of an iteration over currently active font family instances. A font family instance is a typeface and a size—an entry from the font association table.
When the font family iterator is initialized, it does not yet reference a font family instance. Do not attempt to modify the contents of a font family instance iterator.
Fonts.h
Creates a font family iterator that your application can use to access font family objects. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyIteratorCreate
instead.)
OSStatus FMCreateFontFamilyIterator ( const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontFamilyIterator *ioIterator );
A pointer to a filter specification. Pass NULL
if you want to access all font family objects within the scope of your iteration. Otherwise, you can use this parameter to restrict the scope of the iteration to the font families that match a generation count or criteria you specify in a custom filter function. Pass the filter selector constant kFMGenerationFilterSelector
to select a generation filter or the constant kFMFontFamilyCallbackFilterSelector
to select a custom filter. See FMFilterSelector
in the ATS Types Reference for more information on these constants.
An arbitrary 32-bit value specified by your application. If you are using a custom filter function, you can use this parameter to pass data to the custom filter function. If you are not using a custom filter function, pass NULL
.
A value that specifies the scope to which the font family iterator applies. If you want the Font Manager to apply the font family iterator only to the fonts accessible from your application use the kFMLocalIterationScope
constant. If you want the Font Manager to apply the font family iterator to all fonts registered with the system use the constant kFMGlobalIterationScope
. See Activation Contexts for more information on these constants.
A pointer to a structure of type FMFontFamilyIterator
. On input, pass a pointer to an uninitialized structure. On output, the structure’s contents may have been changed and may include references to other data structures allocated by the system to maintain the structure’s state. When you no longer need the font family iterator, you should call the function FMDisposeFontFamilyIterator
to release the auxiliary data and memory allocated by the system.
A result code. See “Font Manager Result Codes.”
A font family iterator is an opaque data structure used by the Font Manager to keep track of an iteration over currently active font families. When the font family iterator is initialized, it does not yet reference a font family. Do not attempt to modify the contents of a font family iterator.
Fonts.h
Creates an iterator that your application can use to access fonts. (Deprecated in Mac OS X v10.4. Use ATSFontIteratorCreate
instead.)
OSStatus FMCreateFontIterator ( const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontIterator *ioIterator );
A pointer to font filter specification. Pass NULL
if you want to access all font objects within the scope of your iteration. Otherwise, you can use this parameter to restrict the scope of the iteration to font information that matches a technology, font container, or criteria you specify in a custom filter function. Pass the filter selector constant kFMFontTechnologyFilterSelector
to select a font technology filter, the constant kFMFontContainerFilterSelector
to select a font container filter, or the constant kFMFontCallbackFilterSelector
to select a custom filter. See FMFilterSelector
in the ATS Types Reference for more information on these constants.
An arbitrary 32-bit value specified by your application. If you are using a custom filter function, you can use this parameter to pass data to the custom filter function. If are not using a custom filter function, pass NULL
.
A value that specifies the scope to which the font iterator applies. If you want the Font Manager to apply the font iterator only to the fonts accessible from your application use the kFMLocalIterationScope
constant. If you want the Font Manager to apply the font iterator to all fonts registered with the system use the constants kFMGlobalIterationScope
. See Activation Contexts for more information on these constants.
A pointer to a structure of type FMFontIterator
. On input, pass a pointer to an uninitialized structure. On output, the structure’s contents may have been changed and may include references to other data structures allocated by the system to maintain the structure’s state. When you no longer need the font iterator, you should call the function FMDisposeFontIterator
to release the auxiliary data and memory allocated by the system.
A result code. See “Font Manager Result Codes.”
A font iterator is an opaque structure used by the Font Manager to maintain font information in the context of the current application process. When the font iterator is initialized, it is not yet positioned on a font object. You should not attempt to modify the contents of a font iterator.
Fonts.h
Deactivates one or more fonts. (Deprecated in Mac OS X v10.4. Use ATSFontDeactivate
instead.)
OSStatus FMDeactivateFonts ( const FSSpec *iFontContainer, const FMFilter *iFilter, void *iRefCon, OptionBits iOptions );
A pointer to the file specification of the file that contains the font data you want to deactivate. You can specify a directory or an individual font file.
A pointer to a filter specification. This parameter is currently reserved for future use, so you should pass NULL
.
An arbitrary 32-bit value specified by your application. This parameter is currently reserved for future use, so you should pass NULL
.
A value that specifies the scope to which the function applies. This parameter is currently reserved for future use, so you should pass NULL
.
A result code. See “Font Manager Result Codes.”
Fonts.h
Disposes of a font family instance iterator. (Deprecated in Mac OS X v10.4.)
OSStatus FMDisposeFontFamilyInstanceIterator ( FMFontFamilyInstanceIterator *ioIterator );
A pointer to a font family instance iterator you created with the function FMCreateFontFamilyInstanceIterator
. If you try to use the font family instance iterator after disposing of its contents through this function, the Font Manager returns an error code to your application.
A result code. See “Font Manager Result Codes.”
Fonts.h
Disposes of the contents of a font family iterator. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyIteratorRelease
instead.)
OSStatus FMDisposeFontFamilyIterator ( FMFontFamilyIterator *ioIterator );
A pointer to a font family iterator you created with the function FMCreateFontFamilyIterator
. If you try to use the font family iterator after disposing of its contents through this function, the Font Manager returns an error code to your application.
A result code. See “Font Manager Result Codes.”
Fonts.h
Disposes of a font iterator. (Deprecated in Mac OS X v10.4. Use ATSFontIteratorRelease
instead.)
OSStatus FMDisposeFontIterator ( FMFontIterator *ioIterator );
A pointer to a font iterator you created with the function FMCreateFontIterator
. If you try to use the font iterator after disposing of its contents through this function, the Font Manager returns an error code to your application.
A result code. See “Font Manager Result Codes.”
Fonts.h
Obtains the ATS font family reference associated with a font family object. (Deprecated in Mac OS X v10.4.)
ATSFontFamilyRef FMGetATSFontFamilyRefFromFontFamily ( FMFontFamily iFamily );
A font family reference.
The ATSFontFamilyRef
associated with the font family object.
Fonts.h
Obtains the file that contains data for a font. (Deprecated in Mac OS X v10.4. Use ATSFontGetContainer
instead.)
OSStatus FMGetFontContainer ( FMFont iFont, FSSpec *oFontContainer );
A font reference.
On output, a pointer to the file specification of the file that contains the font data.
A result code. See “Font Manager Result Codes.”
You can pass the file specification returned by this function to the Resource Manager or File Manager to obtain the actual font data. However, if the font is an LWFN-class font, the outline data is located in a separate file from the font suitcase. The function FMGetFontContainer
obtains the font suitcase. Your application is responsible for finding the individual outline files.
Fonts.h
Obtains the font container associated with a font family instance. (Deprecated in Mac OS X v10.4. Use ATSFontGetContainer
instead.)
OSStatus FMGetFontContainerFromFontFamilyInstance ( FMFontFamily iFontFamily, FMFontStyle iStyle, FMFontSize iFontSize, FSSpec *oFontContainer );
A font family reference for the font family whose container you want to obtain. You must pass a valid font family.
The font style of the font family whose container you want to obtain. You must pass a valid font style.
The font size of the font family whose container you want to obtain. You must pass a valid font size.
On output, a pointer to a file specification that specifies the name and location of the font container.
A result code. See “Font Manager Result Codes.”
Fonts.h
Obtains the font family associated with an ATS font family reference. (Deprecated in Mac OS X v10.4.)
FMFontFamily FMGetFontFamilyFromATSFontFamilyRef ( ATSFontFamilyRef iFamily );
An ATS font family reference.
The font family reference associated with the specified ATS font family reference.
Fonts.h
Returns the font family reference associated with a standard QuickDraw name. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyFindFromName
instead.)
FMFontFamily FMGetFontFamilyFromName ( ConstStr255Param iName );
A QuickDraw font family name.
A font family reference. The function returns kInvalidFontFamily
if it cannot find a matching font family. See the ATS Types documentation for a description of the FMFontFamily
data type.
This function is a replacement for the GetFNum
function. You should use the function FMGetFontFamilyFromName
instead of the function GetFNum
to assure your application supports font formats other than the resource fork TrueType and PostScript Type 1 fonts.
Fonts.h
Obtains the generation count of a font family. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyGetGeneration
instead.)
OSStatus FMGetFontFamilyGeneration ( FMFontFamily iFontFamily, FMGeneration *oGeneration );
A font family reference.
On output, a pointer to the generation count for the font family associated with the font family reference.
A result code. See “Font Manager Result Codes.”
Fonts.h
Finds the font family reference and standard QuickDraw style associated with a font. (Deprecated in Mac OS X v10.4.)
OSStatus FMGetFontFamilyInstanceFromFont ( FMFont iFont, FMFontFamily *oFontFamily, FMFontStyle *oStyle );
A font reference.
A pointer to a font family reference. On output, points to the font family reference associated with the specified font. You are responsible for allocating the memory for the font family reference.
A pointer to a font style. On output, points to the font style associated with the specified font. You are responsible for allocating the memory for the font style.
A result code. See “Font Manager Result Codes.”
A font can be a member of more than one font family. This means if you call the function FMGetFontFromFontFamilyInstance
and then call the function FMGetFontFamilyInstanceFromFont
, you will not necessarily get the font family reference you supplied when you called FMGetFontFromFontFamilyInstance
.
Fonts.h
Obtains the font family name associated with a font family reference. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyGetName
instead.)
OSStatus FMGetFontFamilyName ( FMFontFamily iFontFamily, Str255 oName );
A font family reference.
On output, the string contains the QuickDraw font family name. If the function does not find a name, it returns an empty string and a result code of kFMInvalidFontFamilyErr
.
A result code. See “Font Manager Result Codes.”
This function is a replacement for the GetFontName
function. You should use the function FMGetFontFamilyName
instead of the function GetFontName
to assure your application supports font formats other than the resource fork TrueType and PostScript Type 1 fonts.
Fonts.h
Obtains the font family resource for a font family. (Deprecated in Mac OS X v10.4. Use ATSFontGetFontFamilyResource
instead.)
OSStatus FMGetFontFamilyResource ( FMFontFamily iFontFamily, FMFontStyle iFontStyle, FMFontSize iFontSize, ByteCount iBufferSize, void *ioBuffer, ByteCount *oSize );
A value of type FMFontFamily
that specifies the font family whose resource you want to obtain. You must pass a valid font family.
A value of type FMFontStyle
that specifies the font style of the font family whose resource you want to obtain. You must pass a valid font style.
A value of type FMFontSize
that specifies the font size of the font family whose resource you want to obtain. You must pass a valid font size.
The size of the buffer (ioBuffer
).
A pointer to the buffer used to store a copy of the font family resource. On input, pass NULL
if you want to obtain only the length of the font family resource, not its contents.
On output, the actual size of the buffer.
A result code. See “Font Manager Result Codes.”
You should call the function FMGetFontFamilyResource
twice. First, to get the length of the font family resource. Then after you allocate a buffer (ioBuffer)
of the appropriate size, call the function a second time to obtain the contents of the font family resource.
Fonts.h
Obtains the text encoding used by a font family. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyGetEncoding
instead.)
OSStatus FMGetFontFamilyTextEncoding ( FMFontFamily iFontFamily, TextEncoding *oTextEncoding );
A font family reference.
On output, a pointer to the text encoding used by the font family associated with the font family reference.
A result code. See “Font Manager Result Codes.”
This function is a replacement for the Script Manager function FontToScript
. You should use the function FMGetFontFamilyTextEncoding
instead of the function FontToScript
to ensure your application supports font formats other than the resource fork TrueType and PostScript Type 1 fonts. Unlike the FontToScript
function, the state of the font force flag is ignored and the script system of the font family is not mapped to zero even if the script system is disabled in the current application process.
Once you have obtained the text encoding, you can use Text Encoding Converter Manager function RevertTextEncodingToScriptInfo
to extract the script as follows:
status = FMGetFontFamilyTextEncoding (myFontFamily, &myTextEncoding)
status = RevertTextEncodingToScriptInfo (myTextEncoding, &myScriptCode);
Fonts.h
Obtains the format identifier of a font. (Deprecated in Mac OS X v10.4.)
OSStatus FMGetFontFormat ( FMFont iFont, FourCharCode *oFormat );
A font reference.
On output, a pointer to a four-character-code that represents the format identifier of the font. See the discussion that follows for information on format identifiers.
A result code. See “Font Manager Result Codes.”
A format identifier is a four-character-code, assigned to a font by a font vendor, that identifies the format of a font. Some of the identifiers currently supported in the Mac OS are:
'true'
TrueType fonts use the 32-bit hexadecimal value 0x00010000.
'LWFN'
PostScript Type 1 fonts (“LaserWriter Font”) consist of two parts: a 'FOND'
resource (contained in a font or font suitcase resource file) whose style mapping table references PostScript font data for each typeface (style), stored in separate file. The separate data files have names derived from the PostScript name of the typeface.
'typ1'
PostScript Type 1 fonts are housed in packages that have an 'sfnt'
format (OpenType).
'OTTO'
PostScript compact font format (CFF) font data is housed in a package that has an 'sfnt'
format (OpenType).
Fonts.h
Obtains the font reference associated with a standard QuickDraw style and font family. (Deprecated in Mac OS X v10.4. Use CTFontCreateWithQuickdrawInstance
instead.)
OSStatus FMGetFontFromFontFamilyInstance ( FMFontFamily iFontFamily, FMFontStyle iStyle, FMFont *oFont, FMFontStyle *oIntrinsicStyle );
A font family reference.
A font style.
A pointer to a font reference. On output, points to the font reference for the specified font family and style. You are responsible for allocating the memory for the font reference.
On output, a pointer to an intrinsic font style. If a font object isn’t found that matches the font family reference and font style you specify, the function returns the QuickDraw style that matches most closely.
A result code. See “Font Manager Result Codes.” If a font reference and intrinsic style are not found, the function returns a value of kFMInvalidFontErr
.
Fonts.h
Obtains the generation count of a font. (Deprecated in Mac OS X v10.4. Use ATSFontGetGeneration
instead.)
OSStatus FMGetFontGeneration ( FMFont iFont, FMGeneration *oGeneration );
A font reference.
On output, a pointer to a value that specifies the generation count of the font.
A result code. See “Font Manager Result Codes.”
Fonts.h
Retrieves all or part of a data table for a font. (Deprecated in Mac OS X v10.4. Use ATSFontGetTable
or CTFontCopyTable
instead.)
OSStatus FMGetFontTable ( FMFont iFont, FourCharCode iTag, ByteOffset iOffset, ByteCount iLength, void *iBuffer, ByteCount *oActualLength );
A font reference.
A tag that identifies the data table for a font.
An offset to font table data you want to retrieve. The offset is relative to the beginning of the data table and is zero-based.
The size of the data buffer (ioBuffer
) you allocate.
A pointer to the buffer used to store a copy of the font table. On input, pass NULL
if you want to obtain only the length of the table, not its contents.
On output, the actual length of the font table.
A result code. See “Font Manager Result Codes.”
You should call the function FMGetFontTable
twice. First, call it to retrieve the length of the font table. Then, after you’ve allocated space for the iBuffer
parameter, call the function a second time to obtain the contents of the font table.
Fonts.h
Obtains the table directory for a font. (Deprecated in Mac OS X v10.4.)
OSStatus FMGetFontTableDirectory ( FMFont iFont, ByteCount iLength, void *iBuffer, ByteCount *oActualLength );
A font reference.
The number of bytes in the buffer used to store a copy of the font table directory associated with the font.
A pointer to the buffer used to store a copy of the font table directory. On input, pass NULL
if you want to obtain only the length of the table directory, not its contents.
On output, the length of the font table directory.
A result code. See “Font Manager Result Codes.”
You should call the function FMGetFontTableDirectory
twice. First, call it to retrieve the length of the font table directory. Then, after you’ve allocated space for the iBuffer
parameter, call the function a second time to obtain the contents of the table directory.
Fonts.h
Obtains the next font reference. (Deprecated in Mac OS X v10.4. Use ATSFontIteratorNext
instead.)
OSStatus FMGetNextFont ( FMFontIterator *ioIterator, FMFont *oFont );
A pointer to a font iterator you created using the function FMCreateFontIterator
.
A pointer to a font reference. On output, points to the next font reference obtained by the font iterator. You are responsible for allocating the memory for the font reference.
A result code. See “Font Manager Result Codes.” If there are no more font objects to get, the function FMGetNextFont
returns the result code kFMIterationCompleted
.
Fonts.h
Obtains the next font family reference. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyIteratorNext
instead.)
OSStatus FMGetNextFontFamily ( FMFontFamilyIterator *ioIterator, FMFontFamily *oFontFamily );
A pointer to a font family iterator you created using the function FMCreateFontFamilyIterator
.
A pointer to a font family reference. On output, points to the font family reference obtained by the iterator. You are responsible for allocating memory for the font family reference.
A result code. See “Font Manager Result Codes.” If there are no more font family references to get, the function FMGetNextFontFamily
returns the result code kFMIterationCompleted
.
If any changes are made to the font database while you are using the font family iterator, the iterator is invalidated and the function FMGetNextFontFamily
returns the error kFMIteratorScopeModified
. To remedy this error, your application must either restart or cancel the enumeration by calling the FMResetFontFamilyIterator
or the FMDisposeFontFamilyIterator
functions.
Fonts.h
Obtains the next instance associated with a font family reference. (Deprecated in Mac OS X v10.4.)
OSStatus FMGetNextFontFamilyInstance ( FMFontFamilyInstanceIterator *ioIterator, FMFont *oFont, FMFontStyle *oStyle, FMFontSize *oSize );
A pointer to a font family instance iterator you created with the function FMCreateFontFamilyInstanceIterator
.
A pointer to a font reference. On output, points to the font reference obtained by the iterator. You are responsible for allocating the memory for the font reference.
A pointer to a font style. On output, points to the font style obtained by the iterator. You are responsible for allocating the memory for the font style.
A pointer to a font size. On output, points to the font size obtained by the iterator. You are responsible for allocating the memory for the font size.
A result code. See “Font Manager Result Codes.” If there is no more font family information to retrieve, the function FMGetNextFontFamlyInstance
returns the status code kFMIterationCompleted
.
Instances are not necessarily retrieved in the order they are listed in a Font Association Table.
If any changes are made to the font database while your application is using the font family instance iterator, the iterator is invalidated and the function FMGetNextFontFamilyInstance
returns the error kFMIteratorScopeModified
. To remedy this error, your application must either call the FMResetFontFamilyInstanceIterator
or the FMDisposeFontFamilyInstanceIterator
functions.
Fonts.h
Resets the a font family instance iterator to the beginning of the iteration for the specified font family. (Deprecated in Mac OS X v10.4.)
OSStatus FMResetFontFamilyInstanceIterator ( FMFontFamily iFontFamily, FMFontFamilyInstanceIterator *ioIterator );
A font family reference.
A pointer to a font family instance iterator you created with the function FMCreateFontFamilyInstanceIterator
.
A result code. See “Font Manager Result Codes.”
Once you have created a font family instance iterator, you can reuse it by calling the function FMResetFontFamilyInstanceIterator
. This function sets the iFontFamily
parameter to the new font family object you specify, and repositions the iterator so it is ready to get the first font family instance when you call the function FMGetNextFontFamilyInstance
.
Fonts.h
Resets a font family iterator to the beginning of the iteration. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyIteratorReset
instead.)
OSStatus FMResetFontFamilyIterator ( const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontFamilyIterator *ioIterator );
A pointer to a filter specification. Pass NULL
if you want to access all font family objects within the scope of your iteration. Otherwise, you can use this parameter to restrict the scope of the iteration to the font families that match a generation count or criteria you specify in a custom filter function.
An arbitrary 32-bit value specified by your application. If you are using a custom filter function, you can use this parameter to pass data to the custom filter function. If you are not using a custom filter function, pass NULL
.
A value that specifies the scope to which the font family iterator applies. If you want the Font Manager to apply the font family iterator only to the fonts accessible from your application use the kFMLocalIterationScope
constant. If you want the Font Manager to apply the font family iterator to all fonts registered with the system use the constant kFMGlobalIterationScope
.
A pointer to a font family iterator you created with the function FMCreateFontFamilyIterator
. On output, the font family iterator is reset.
A result code. See “Font Manager Result Codes.”
Once you have created a font family iterator, you can reuse it by calling the function FMResetFontFamilyIterator
. This function sets the parameters to the new values you specify, and repositions the iterator so it is ready to get the first font family reference when you call the function FMGetNextFontFamily
.
Fonts.h
Resets a font iterator to the beginning of the iteration. (Deprecated in Mac OS X v10.4. Use ATSFontIteratorReset
instead.)
OSStatus FMResetFontIterator ( const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontIterator *ioIterator );
A pointer to font filter specification. Pass NULL
if you want to access all font objects within the scope of your iteration. Otherwise, you can use this parameter to restrict the scope of the iteration to font information that matches a technology, font container, or criteria you specify in a custom filter function. Pass the filter selector constant kFMFontTechnologyFilterSelector
to select a font technology filter, the constant kFMFontContainerFilterSelector
to select a font container filter, or the constant kFMFontCallbackFilterSelector
to select a custom filter. See FMFilterSelector
in the ATS Types Reference for more information on these constants.
An arbitrary 32-bit value specified by your application. If you are using a custom filter function, you can use this parameter to pass data to the custom filter function. If are not using a custom filter function, pass NULL
.
A value that specifies the scope to which the font iterator applies. If you want the Font Manager to apply the font iterator only to the fonts accessible from your application use the kFMLocalIterationScope
constant. If you want the Font Manager to apply the font iterator to all fonts registered with the system use the constant kFMGlobalIterationScope
.
A pointer to a font iterator you created with the function FMCreateFontIterator
. On output, the font iterator is not positioned on a font object, and any information about font objects that were returned previously in the font iterator is no longer available.
A result code. See “Font Manager Result Codes.”
Once you have created a font iterator, you can reuse it by calling the function FMResetFontIterator
. This function sets the parameters to the new values you specify, and repositions the iterator so it is ready to get the first font object when you call the function FMGetNextFont
.
Fonts.h
Returns a pointer to the font output structure for a specified font. (Deprecated in Mac OS X v10.4. There is no replacement function.)
FMOutPtr FMSwapFont ( const FMInput *inRec );
A pointer to the font input structure for which you want to obtain font output information. A font input structure contains the font family ID, the style requested, scaling factors, and other information that specifies the characteristics of the font that is requested.
A pointer to a font output structure (FMOutput
). The font output structure contains a handle to the font resource for the specified input font, along with information about the font, such as the ascent, descent, and leading measurements.
The function FMSwapFont
is typically called by QuickDraw and other parts of the system software to access font handles. QuickDraw calls the FMSwapFont
function every time a QuickDraw text function is used.
In most cases you don’t need to call this function. If you want to call the FMSwapFont
function to get a handle to a font resource or information about a font, you must first create a font input structure and fill it with the appropriate information. You can use the pointer returned by FMSwapFont
to access the font output structure. You cannot assume that the font resource pointed to by the fontHandle
field of the font output structure returned by this function is of any particular type, such as 'NFNT'
or 'sfnt'
. If you need to access specific information in the font resource, call the Resource Manager function GetResInfo
with the handle returned in the font output structure to determine the font resource type.
The pointer to the font output structure returned by the function FMSwapFont
points to a structure allocated in low memory by the Font Manager. The same structure is reused for each call made to FMSwapFont
. Do not free the memory allocated for this structure.
Fonts.h
Obtains fractional measurements for the font, size, and style specified in the current graphics port. (Deprecated in Mac OS X v10.4. There is no replacement function.)
void FontMetrics ( FMetricRecPtr theMetrics );
A pointer to a font metrics structure. On output, the structure contains the font measurement information in fractional values.
The FontMetrics
function obtains measurements for the ascent, descent, leading, and width of the largest glyph in the font for the font, size, and style specified in the current graphics port.
The font metrics structure (of data type FMetricRec
) contains a handle to the global width table, which in turn contains a handle to the associated font family resource for the current font (the font in the current graphics port). It also contains the values of four measurements for the current font.
The FontMetrics
function is similar to the QuickDraw function GetFontInfo
except that FontMetrics
returns fractional values for greater accuracy in high-resolution printing. The FontMetrics
function also does not take into account any additional widths that are added by QuickDraw when it applies styles to the glyphs in a font.
Fonts.h
Returns the font family ID of the current application font. (Deprecated in Mac OS X v10.4. There is no replacement function.)
short GetAppFont ( void );
The font family ID of the current application font. This is the font family ID that has been mapped to 1 by the system software.
Fonts.h
Determines the default size of the system font. (Deprecated in Mac OS X v10.4. There is no replacement function.)
short GetDefFontSize ( void );
The the default font size of the system font.
You can determine the preferred size for either the system font or the application font of any enabled script system by calling the Script Manager function GetScriptManagerVariable
.
Fonts.h
Obtains the font family ID for a specified font family name. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyFindFromName
instead.)
Not recommended.
void GetFNum ( ConstStr255Param name, short *familyID );
The font family name.
On output, a pointer to the font family ID for the font family specified in name
. If the font specified in the parameter name
does not exist, the font family ID contains 0.
You should use the function FMGetFontFamilyFromName
instead of the function GetFNum
.
Fonts.h
Obtains the name of a font family that has a specified family ID number. (Deprecated in Mac OS X v10.4. Use ATSFontFamilyGetName
instead.)
Not recommended.
void GetFontName ( short familyID, Str255 name );
The font family ID.
On output, this parameter contains the font family name for the font family specified in familyID
. If the font specified in the familyID
parameter does not exist, name
contains an empty string.
Fonts.h
Obtains the current preference for whether outline or bitmapped fonts are returned when the Font Manager receives a font request. (Deprecated in Mac OS X v10.4. There is no replacement function.)
Boolean GetOutlinePreferred ( void );
The value of the Font Manager’s current preference for outline or bitmapped fonts. If GetOutlinePreferred
returns TRUE
, then the Font Manager will return an outline font when both an outline font and a bitmapped font are available for a particular request. If GetOutlinePreferred
returns FALSE
, then the Font Manager will return the bitmapped font when both types are available. See the Debugger Services documentation for a description of the Boolean
data type.
Fonts.h
Determines whether the Font Manager preserves the shapes of glyphs from outline fonts. (Deprecated in Mac OS X v10.4. There is no replacement function.)
Boolean GetPreserveGlyph ( void );
A Boolean
value that indicates whether the Font Manager preserves the shapes of glyphs from outline fonts. Your application can set the value of this variable with the SetPreserveGlyph
function. If GetPreserveGlyph
returns TRUE
, the Font Manager preserves glyph shapes; if GetPreserveGlyph
returns FALSE
, then the Font Manager scales glyphs to fit between the ascent and descent lines for the font in use.
Fonts.h
Obtains the font family ID of the current system font. (Deprecated in Mac OS X v10.4. There is no replacement function.)
short GetSysFont ( void );
The current value of the font family ID of the current system font. This is the font family ID that has been mapped to 0 by the system software.
Fonts.h
Checks whether antialiased text is enabled. (Deprecated in Mac OS X v10.4. There is no replacement function.)
Boolean IsAntiAliasedTextEnabled ( SInt16 *oMinFontSize );
On output, points to the minimum font size for which antialiasing is enabled.
Returns true
if antialiased text is enabled; false
otherwise.
Fonts.h
Determines whether the specified scaling factors will cause the Font Manager to choose an outline font for the current graphics port. (Deprecated in Mac OS X v10.4. There is no replacement function.)
Boolean IsOutline ( Point numer, Point denom );
The numerators of the vertical and horizontal scaling factors. The numer
parameter is of type Point
, and contains two fields: h
(the numerator of the ratio for horizontal scaling) and v
(the numerator of the ratio for vertical scaling).
The denominators of the vertical and horizontal scaling factors. The denom
parameter is of type Point
, and contains two fields: h
(the denominator of the ratio for horizontal scaling) and v
(the denominator of the ratio for vertical scaling).
Returns TRUE
if the Font Manager will choose an outline font for the current graphics port.
The Font Manager uses the font scaling factors specified in the numer
and denom
parameters as well as the current preference (as set by the SetOutlinePreferred
function) as criteria to choose which font to use.
Fonts.h
Obtains font measurements for a block of text to be drawn in a specified outline font. (Deprecated in Mac OS X v10.4. There is no replacement function.)
OSErr OutlineMetrics ( short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray );
The number of bytes in the block of text that you want measured.
A pointer to the block of text that for which you want to obtain font measurements.
The numerators of the vertical and horizontal scaling factors. The numer
parameter is of type Point
, and contains two fields: h
(the numerator of the ratio for horizontal scaling) and v
(the numerator of the ratio for vertical scaling). The Font Manager applies these scaling factors to the current font when calculating the measurements for glyphs in the block of text.
The denominators of the vertical and horizontal scaling factors. The denom
parameter is of type Point
, and contains two fields: h
(the denominator of the ratio for horizontal scaling) and v
(the denominator of the ratio for vertical scaling). The Font Manager applies these scaling factors to the current font when calculating the measurements for glyphs in the block of text.
On output, a pointer to the maximum y-value for the text. Pass NULL
in this parameter if you don’t want this value returned.
On output, a pointer to the minimum y-value for the text. Pass NULL
in this parameter if you don’t want this value returned.
A pointer to an array. On output the array is filled with the advance width measurements for the glyphs being measured. These measurements are in pixels, based on the point size and font scaling factors of the current font. There is an entry in this array for each glyph that is being measured.
The awArray
parameter is of type FixedPtr
. The FixedPtr
data type is a pointer to an array, and each entry in the array is of type Fixed
, which is 4 bytes in length. Multiply byteCount
by 4 to calculate the memory you need in bytes.
If the FractEnable
global variable has been set to TRUE
through the SetFractEnable
function, the values in awArray
have fractional character widths. If FractEnable
has been set to FALSE
, the Font Manager returns integer values for the advance widths, with 0 in the decimal part of the values.
A pointer to an array. On output the array is filled with the left-side bearing measurements for the glyphs being measured. The measurements are in pixels, based on the point size of the current font. There is an entry in this array for each glyph that is being measured.
The lsbArray
parameter is of type FixedPtr
. The FixedPtr
data type is a pointer to an array, and each entry in the array is of type Fixed
, which is 4 bytes in length. Multiply byteCount
by 4 to calculate the memory you need in bytes.
The fractional portion of left-side bearing values are retained.
A pointer to an array. On output the array is filled with the bounding boxes for the glyphs being measured. Bounding boxes are the smallest rectangles that fit around the pixels of the glyph. There is an entry in this array for each glyph that is being measured.
The coordinate system used to describe the bounding boxes is in pixel units, centered at the glyph origin, and with a vertical positive direction upwards. This is the opposite of the QuickDraw vertical orientation.
The boundsArray
parameter is of type RectPtr
. The RectPtr
data type is a pointer to QuickDraw’s Rect
data type, which is 8 bytes in length. Multiply byteCount
by 8 to calculate the memory you need in bytes. Allocate the memory needed for the array and pass a pointer to the array in the boundsArray
parameter.
A result code. See “Font Manager Result Codes.”
The OutlineMetrics
function computes the maximum y-value, minimum y-value, advance widths, left-side bearings, and bounding boxes for a block of text. It uses the font, size, and style specified in the current graphics port. You can use these measurements when laying out text. You may need to adjust line spacing to accommodate exceptionally large glyphs.
The OutlineMetrics
function works for outline fonts only and is the preferred method for measuring text that is drawn with an outline font.
When you are using OutlineMetrics
to compute advance width values, left-side bearing values, or bounding boxes, you need to bear in mind that when a text block contains 2-byte characters, not every byte in the awArray
, lsbArray
, and boundsArray
structures is used. Each of these arrays is indexed by the glyph index; thus, if you have five characters in a string, only the first five entries in each array contains a value. Call the Script Manager function CharByte
to determine how many characters there are in the text block, and ignore the unused array entries (which occur at the end of each array).
If you don’t want OutlineMetrics
to compute one of these three values, pass NULL
in the applicable parameter. Otherwise, allocate the amount of memory needed for the array and pass a pointer to it in this parameter.
Fonts.h
Obtains a rectangle that specifies the bounds of QuickDraw text. (Deprecated in Mac OS X v10.4. There is no replacement function.)
void QDTextBounds ( short byteCount, const void *textAddr, Rect *bounds );
The number of bytes in the buffer that contains the text whose bounds you want to obtain.
A pointer to a buffer that contains the text whose bounds you want to obtain. You must allocate this buffer.
On output, points to a rectangle that specifies the bounds of QuickDraw text.
Fonts.h
Determines whether a font is available or is intended for use in a specified size. (Deprecated in Mac OS X v10.4. There is no replacement function.)
Boolean RealFont ( short fontNum, short size );
The font family ID.
The font size requested.
Returns TRUE
if the requested size of the font is available. The function RealFont
first checks for a bitmapped font from the specified family. If one is not available, RealFont
checks next for an outline font. If neither kind of font is available, RealFont
returns FALSE
.
If an outline font exists for the requested font family, RealFont
normally considers the font to be available in any requested size. However, the font designer can include instructions in the font that outlines should not be used at certain point sizes, in which case the RealFont
function considers the font unavailable and returns FALSE
. The Font Manager determines whether the size is valid by testing the value of the smallest readable size element of the font family header table.
Fonts.h
Enables or disables antialiased text for an application. (Deprecated in Mac OS X v10.4. There is no replacement function.)
OSStatus SetAntiAliasedTextEnabled ( Boolean iEnable, SInt16 iMinFontSize );
A Boolean
value. Pass true
to enable antialiased text or false
to disable it.
A integer of type SInt16
that specifies the minimum font size to which antialiasing should be enabled.
A result code. See “Font Manager Result Codes.”
Fonts.h
Enables or disables fractional glyph widths. (Deprecated in Mac OS X v10.4. There is no replacement function.)
void SetFractEnable ( Boolean fractEnable );
Specifies whether fractional widths or integer widths are to be used to determine glyph measurements. A value of TRUE
indicates fractional glyph widths; a value of FALSE
indicates integer glyph widths.
The SetFractEnable
function assigns the value that you specify in the fractEnable
parameter to the global variable FractEnable
.
The SetFractEnable
function establishes whether or not the Font Manager provides fractional glyph widths to QuickDraw, which then uses them for advancing the pen during text drawing.
The Font Manager defaults to integer widths to ensure compatibility with existing applications. When fractional glyph widths are enabled, the Font Manager can determine the locations of glyphs more accurately than is possible with integer widths.
Fonts.h
Enables or disables the computation of font scaling factors by the Font Manager for bitmapped glyphs. (Deprecated in Mac OS X v10.4. There is no replacement function.)
void SetFScaleDisable ( Boolean fscaleDisable );
Specifies whether bitmapped fonts are to be scaled. A value of TRUE
indicates that font scaling is disabled; a value of FALSE
indicates that font scaling is enabled.
If you set the fscaleDisable
parameter to TRUE
, the Font Manager disables font scaling, which means it responds to a request for a font size that is not available by computing font scaling factors of 1/1 and returning a smaller, unscaled bitmapped font with the widths of the requested size. If you set the fscaleDisable
parameter to FALSE
, the Font Manager computes scaling factors for bitmapped fonts.
QuickDraw performs the actual scaling of glyph bitmaps for bitmapped fonts by using the font scaling factors computed and returned by the Font Manager.
When font scaling is enabled, the Font Manager can scale a bitmapped glyph that is present in the System file to imitate the appearance of a bitmapped glyph in another point size that is not present. By default, the Font Manager scales fonts to ensure compatibility with existing applications.
Fonts.h
Sets the preference for whether to use bitmapped or outline fonts when both kinds of fonts are available. (Deprecated in Mac OS X v10.4. There is no replacement function.)
void SetOutlinePreferred ( Boolean outlinePreferred );
Specifies whether the Font Manager chooses an outline font or a bitmapped font when both are available to fill a font request. A value of TRUE
indicates an outline font; a value of FALSE
indicates a bitmapped font.
If you want the Font Manager to choose outline fonts over any bitmapped font counterparts, set the outlinePreferred
parameter to TRUE
. If you want it to choose bitmapped fonts, set the outlinePreferred
parameter to FALSE
.
If an outline font and a bitmapped font are both 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 outline fonts were not available. The SetOutlinePreferred
function sets the Font Manager’s current preference for either bitmapped or outline fonts when both are available.
If only outline fonts are available, the Font Manager chooses them regardless of the value of the outlinePreferred
parameter. If only bitmapped fonts are available, they are chosen. The Font Manager chooses bitmapped versus outline fonts on a size basis, before it takes stylistic variations into account, which can lead to unexpected results.
The preference you set is valid only during the current session with your application. The outlinePreferred
parameter does not set a global variable.
Fonts.h
Temporarily changes the default behavior of the Font Manager, so that it does not scale oversized glyphs. (Deprecated in Mac OS X v10.4. There is no replacement function.)
void SetPreserveGlyph ( Boolean preserveGlyph );
Specifies whether or not glyphs from an outline font are scaled to fit between the ascent and descent lines. If you set the value of the preserveGlyph
parameter to TRUE
, the measurements of all glyphs are preserved, which means that your application may have to alter the leading between lines in a document if some of the glyphs extend beyond the ascent or descent lines. If you set the value of the preserveGlyph
parameter to FALSE
, all glyphs are scaled to fit between the ascent and descent lines.
The SetPreserveGlyph
function establishes how the Font Manager treats glyphs that do not fit between the ascent and descent lines for the current font. The default behavior for the Font Manager is to scale a glyph from an outline font so that it fits between the ascent and descent lines; however, this alters the appearance of the glyph.
You can determine the current behavior of the Font Manager in this regard by calling the GetPreserveGlyph
function. To ensure that documents have the same appearance whenever they are opened, you need to call GetPreserveGlyph
and save the value that it returns with your documents and restore it each time a document is displayed by your application.
Fonts.h
Retrieves the value of the generation count. (Deprecated in Mac OS X v10.5. Use ATSGetGeneration
instead.)
FMGeneration FMGetGeneration ( void );
The generation count. See the ATS Types documentation for a description of the FMGeneration
data type.
Any operation that adds, deletes, or modifies one or more font families or fonts triggers an update of the global generation count. You can use this function in conjunction with the iteration functions to identify changes made to the font database.
Fonts.h
© 2002, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-12-11)