Important: The information in this document is obsolete and should not be used for new development.
FontMetrics
TheFontMetricsprocedure 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
TheFontMetricsprocedure 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.FontMetricsreturns 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, andleadingfields of the font metrics record.The
FontMetricsprocedure is similar to QuickDraw'sGetFontInfoprocedure, except thatFontMetricsreturns fractional values for greater accuracy in high-resolution printing.FontMetricsalso 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 theFontMetricsprocedure is
Trap macro _ FontMetricsSEE ALSO
TheGetFontInfoprocedure is described in the chapter "QuickDraw Text" in this book.