Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 7 - Pictures / Pictures Reference
Data Structures /


FontSpec

If you specify the recordFontInfo constant in the verb parameter to the GetPictInfo function (described on page 7-46) or the NewPictInfo function (described on page 7-52), your application receives a PictInfo record (described beginning on page 7-31) that includes in its fontHandle field a handle to an array of FontSpec records. The uniqueFonts field of the PictInfo record indicates the number of FontSpec records in this array. (For bitmap fonts, a font is a complete set of glyphs in one size, typeface, and style--for example, 12-point Geneva italic. For outline fonts, a font is a complete set of glyphs in one typeface and style--for example, Geneva italic.)

The FontSpec record is defined as follows:

TYPE FontSpec =         {font specification record}
RECORD
   pictFontID: Integer; {font ID as stored in the picture}
   sysFontID:  Integer; {font family ID}
   size:       ARRAY[0..3] OF LongInt;
                        {each bit set from 1 to 127 indicates a }
                        { point size at that value; if bit 0 is }
                        { set, then a size larger than 127 }
                        { points is found}
   style:      Integer; {styles used for this font family}
   nameOffset: LongInt; {offset to font name stored in the }
                        { data structure indicated by the }
                        { fontNamesHandle field of the PictInfo }
                        { record}
END; 
Field Description
pictFontID
The ID number of the font as it is stored in the picture.
sysFontID
The number that identifies the resource file (of type 'FOND') that specifies the font family. Every font family--which consists of a complete set of fonts for one typeface including all available styles and sizes of the glyphs in that typeface--has a unique font family ID, in a range of values that determines the script system to which the font family belongs.
size
The point sizes of the fonts in the picture. The field contains 128 bits, in which a bit is set for each point size encountered, from 1 to 127 points. Bit 0 is set if a size larger than 127 is found.
style
The styles for this font family at any of its sizes. The values in this field can also be represented with the Style data type:
               TYPE 
                  StyleItem = (bold, italic, underline, outline, 
                               shadow, condense, extend);
                  Style = SET OF StyleItem;
nameOffset
The offset into the list of font names (indicated by the fontNamesHandle field of the PictInfo record) at which the name for this font family is stored. A font name, such as Geneva, is given to a font family to distinguish it from other font families.
When you are finished using the information returned in a FontSpec record, you should use the DisposeHandle procedure (described in Inside Macintosh: Memory) to dispose of the memory allocated to it.

See the chapter "Font Manager" in Inside Macintosh: Text for more information about fonts.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996