ImagerTypefaceExtras.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Michael Plass, June 6, 1985 11:52:08 pm PDT
DIRECTORY ImagerTypeface USING [ROPE, Typeface];
ImagerTypefaceExtras: CEDAR DEFINITIONS
~ BEGIN OPEN ImagerTypeface;
GenericCreator: TYPE ~ REF GenericCreatorRep;
GenericCreatorRep: TYPE ~ RECORD [
data: REF,
proc: GenericCreatorProc,
priority: INTEGER ← 0
];
GenericCreatorProc: TYPE ~ PROC [self: GenericCreator, name: ROPE] RETURNS [Typeface];
RegisterGenericCreator: PROC [genericCreator: GenericCreator];
Generic creators provide the ability to make typefaces that are a computed function of the name; for example, the name might contain real-valued parameters which determine the shape of the font. The registered genericCreators are called in priority order, each getting a chance to claim the typeface by returning a non-NIL value. In case of a priority clash, the last one registered wins. The normal creation procedure effectively has a priority of 1/2.
END.