Important: The information in this document is obsolete and should not be used for new development.
FontMetrics
TheFontMetrics
procedure gets fractional measurements for the font, size, and style specified in the current graphics port.
PROCEDURE FontMetrics (VAR theMetrics: FMetricRec);
theMetrics
- A font metrics record that contains the font measurement information, in fractional values.
DESCRIPTION
TheFontMetrics
procedure returns 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.FontMetrics
returns this information in a font metrics record.The font metrics record (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.
Type FMetricRec = RECORD ascent: Fixed; {baseline to top} descent: Fixed; {baseline to bottom} leading: Fixed; {leading between lines} widMax: Fixed; {maximum glyph width} wTabHandle: Handle; {handle to global width table} END;You can determine the line height, in pixels, by adding the values of the
Field Description
ascent
- The measurement from the baseline to the ascent line of the font.
descent
- The measurement from the baseline to the descent line of the font.
leading
- The measurement from the descent line to the ascent line below it.
widMax
- The width of the largest glyph in the font.
wTabHandle
- A handle to the global width table.
ascent
,descent
, andleading
fields of the font metrics record.The
FontMetrics
procedure is similar to QuickDraw'sGetFontInfo
procedure, except thatFontMetrics
returns fractional values for greater accuracy in high-resolution printing.FontMetrics
also does not take into account any additional widths that are added by QuickDraw when it applies styles to the glyphs in a font.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theFontMetrics
procedure is
Trap macro _ FontMetrics
SEE ALSO
TheGetFontInfo
procedure is described in the chapter "QuickDraw Text" in this book.