<> <> <> <<>> DIRECTORY CD, Rope USING [ROPE], Graphics USING [FontRef]; CDTexts: CEDAR DEFINITIONS = BEGIN TextPtr: TYPE = REF TextRec; TextRec: TYPE = RECORD [ text: Rope.ROPE, font: REF FontRec ]; FontRec: TYPE = RECORD [ font: Graphics.FontRef, baseOffsetX: REAL _ 0.0, --after scaling baseOffsetY: REAL _ 0.0, --after scaling scaling: BOOL _ FALSE, scale: REAL _ 1, height: CD.DesignNumber _ -1, --after scaling whiteBorder: CD.DesignNumber _ 0, --border offset on creation scaleByReplacingFontAllowed: BOOL _ FALSE, levelSubstitute: CD.Level _ CD.combined, key: ATOM _ NIL, --unique for the technology name: Rope.ROPE _ NIL, --if known technology: CD.Technology_NIL, properties: CD.Properties _ NIL, data: REF ANY _ NIL ]; CreateText: PROC [text: Rope.ROPE, font: REF FontRec, level: CD.Level _ CD.combined] RETURNS [CD.ObPtr]; InstallFont: PROC [font: REF FontRec, key: ATOM_NIL, technology: CD.Technology] RETURNS [done: BOOL]; <<--key and technology overwrite font^>> <<--done means GetFont would find the font>> <<--caller is supposed not to change font^ after Installation>> <<>> GetFont: PROC[key: ATOM, technology: CD.Technology _ NIL] RETURNS [REF FontRec]; <<--returns NIL if not found>> MakeFont: PROC [ name: Rope.ROPE_NIL, scale: REAL _ 1, height: CD.DesignNumber _ 0, whiteBorder: CD.DesignNumber _ -1, baseOffsetX: REAL _ -1, baseOffsetY: REAL _ -999, scaleByReplacingFontAllowed: BOOL _ FALSE, levelSubstitute: CD.Level _ CD.combined] RETURNS [REF FontRec]; <<--returns NIL if not found; >> <<--corrects height, whiteBorder, baseOffsetX, baseOffsetY if not reasonable>> END.