Carbon


FNSReferenceCreateFromFamily

Header: FontSync.h Carbon status: Supported

Creates a font reference based on a font family and style.

OSStatus FNSReferenceCreateFromFamily (
    FMFontFamily iFamily, 
    FMFontStyle iStyle, 
    FNSFontReference *oReference, 
    Style *oActualStyle, 
    FMFontStyle *oActualStyle
);
Parameter descriptions
iFamily

The font family of the font whose reference you wish to create.

iStyle

The style of the font family. This value is often not the actual style of the font reference being created, since there are often left-over style bits. The actual style of the newly-created font reference is passed back in the oActualStyle parameter. For more information, see the discussion.

oReference

The desired format version of the font reference. Pass a value in the range returned by the function FNSSysInfoGet in the oCurRefVersion and oMinRefVersion fields of the system information structure. To specify the most recent version supported by the FontSync library regardless of format version, pass the constant kFNSVersionDontCare, described in “Version Constants”.

oActualStyle

On return, a pointer to a reference to the newly-created FontSync reference.

oActualStyle

On return, a pointer to the actual style of the newly-created font reference. This value may differ from the value you passed in the iStyle parameter. For more information, see the discussion. This value may be NULL.

function result

A result code. The result code kFNSBadReferenceVersionErr indicates that you requested an unsupported reference format version. The Font Manager result code kFMInvalidFontFamilyErr indicates that a font family is invalid. Memory Manager errors indicate that a font reference could not be created because you did not have enough memory available in your heap.

DISCUSSION

You should call the FNSReferenceCreateFromFamily function to create a font reference if your application uses QuickDraw Text to render text.

The style you specify in the iStyle parameter is often not the actual style of the font reference being created, since there may not be a real face corresponding to that style. For example, a family may not have a real italic face, so any italicization is handled by skewing the glyphs. The actual style of the newly-created font reference is passed back in the oActualStyle parameter.

The FNSReferenceCreateFromFamily function requires that you specify the desired font reference format version because there will likely be changes to the nature of the “fingerprints” in a font reference in future versions. This allows earlier versions of FontSync to use the font references you create.

VERSION NOTES

Available beginning with FontSync 1.0.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when Font Sync 1.0 or later is present.


© 2000 Apple Computer, Inc. (Last Updated 7/13/2000)