CDTexts.mesa A Chipndale module
Copyright © 1983 by Xerox Corporation. All rights reserved.
by Christian Jacobi July 29, 1983 10:42 am
last edited by Christian Jacobi November 21, 1983 3:26 pm
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: BOOLFALSE,
scale: REAL ← 1,
height: CD.DesignNumber ← -1, --after scaling
whiteBorder: CD.DesignNumber ← 0, --border offset on creation
scaleByReplacingFontAllowed: BOOLFALSE,
layerSubstitute: CD.Layer ← CD.combined,
key: ATOMNIL, --unique for the technology
name: Rope.ROPENIL, --if known
technology: CD.Technology←NIL,
properties: CD.Properties ← NIL,
data: REF ANYNIL
];
CreateText: PROC [text: Rope.ROPE, font: REF FontRec, layer: CD.Layer ← CD.combined] RETURNS [CD.ObPtr];
InstallFont: PROC [font: REF FontRec, key: ATOMNIL, 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.ROPENIL,
scale: REAL ← 1,
scaleByReplacingFontAllowed: BOOLFALSE,
layerSubstitute: CD.Layer ← CD.combined]
RETURNS [REF FontRec];
--returns NIL if not found;
END.