<> <> <> <<>> DIRECTORY Font USING [FONT, FontBoundingBox, RoundedTextWidth, Width], Real USING [RoundI], Rope USING [ROPE]; VFonts: CEDAR DEFINITIONS IMPORTS Font, Real = BEGIN <> FONT: TYPE = Font.FONT; EstablishFont: PROC [family: Rope.ROPE, size: CARDINAL, bold, italic: BOOL _ FALSE, defaultOnFailure: BOOL _ TRUE] RETURNS [FONT] ; FontAscent: PROC [font: FONT] RETURNS [ascent: INTEGER] = INLINE {RETURN[Real.RoundI[Font.FontBoundingBox[font].ymax]]}; FontHeight: PROC [font: FONT] RETURNS [height: INTEGER] = INLINE {RETURN[Real.RoundI[Font.FontBoundingBox[font].ymax-Font.FontBoundingBox[font].ymin]]}; CharWidth: PROC [char: CHAR, font: FONT _ defaultFont] RETURNS [width: INTEGER] = INLINE {RETURN[Real.RoundI[Font.Width[font, char]]]}; RopeWidth: PROC [rope: Rope.ROPE, font: FONT _ defaultFont] RETURNS [width: INTEGER] = INLINE{RETURN[Font.RoundedTextWidth[font, rope]]}; defaultFont: FONT; END.