ImagerFontWorks.mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Michael Plass, May 2, 1990 3:06 pm PDT
Procedures for accessing font glyphs.
DIRECTORY
Imager USING [Context],
ImagerFont USING [Font, XChar],
ImagerMaskCache USING [CharMask, Parameters],
ImagerPath USING [ArcToProc, ConicToProc, CurveToProc, LineToProc, MoveToProc];
ImagerFontWorks: CEDAR DEFINITIONS
~ BEGIN OPEN ImagerFont, ImagerPath;
Parameters: TYPE ~ ImagerMaskCache.Parameters;
MaskChar: PROC [font: Font, char: XChar, context: Imager.Context];
Masks a single character; does not cache
MapCharProc: TYPE ~ PROC [font: Font, char: XChar, parameters: Parameters,
moveTo: MoveToProc, lineTo: LineToProc, curveTo: CurveToProc, arcTo: ArcToProc, conicTo: ConicToProc]
RETURNS [success: BOOL ¬ TRUE];
MapChar: MapCharProc;
If possible, maps the outline of the character. May do some adjustment of the contour, if appropriate Parameters are provided.
CaptureChar: PROC [font: Font, char: XChar, parameters: Parameters, metricsOnly: BOOL ¬ FALSE] RETURNS [ImagerMaskCache.CharMask];
The transformation in font is into device coordinates, with x~s and y~f.
Returns NIL if the operator must be re-executed each time, and nothing can be said about the bounding box and/or width.
Returns culled variant if metricsOnly=TRUE.
Returns maskNotCacheable variant if the operator cannot be cached for some reason, but its bounding box and escapement are known.
Otherwise returns cached variant, using cost functions in parameters to determine the representation.
END.