RasterFontWriter.mesa
Michael Plass, January 13, 1984 11:24 am
DIRECTORY ImagerPixelMaps, Rope;
RasterFontWriter: CEDAR DEFINITIONS ~ BEGIN
InternalFont: TYPE ~ REF InternalFontRep;
InternalFontRep:
TYPE ~
RECORD [
family: Rope.ROPE ← NIL,
face: [0..255] ← 0,
bitsPerEmQuad: REAL ← 0,
defaultChar: InternalCharRep,
charRep: ARRAY CHAR OF InternalCharRep
];
InternalCharRep:
TYPE ~
RECORD [
fWidth, sWidth: REAL,
pixels: ImagerPixelMaps.PixelMap
];
Load:
PROC [fileName: Rope.
ROPE]
RETURNS [InternalFont];
may raise:
FormatError: ERROR [byteIndex: INT];
Create: PROC [defaultBoxBounds: ImagerPixelMaps.DeviceRectangle, defaultWidth: INTEGER] RETURNS [InternalFont];
ComputeFontMetrics: PROC [internalFont: InternalFont] RETURNS [bc, ec: CHAR, sMin, fMin, sMax, fMax: INTEGER, maxWidth, totalWidth, fSizeStrike: CARDINAL];
Trim:
PROC [internalFont: InternalFont];
Removes extra zero bits from all the rasters.
WriteStrike: PROC [internalFont: InternalFont, fileName: Rope.ROPE];
WriteKernedStrike: PROC [internalFont: InternalFont, fileName: Rope.ROPE];
WriteAC: PROC [internalFont: InternalFont, fileName: Rope.ROPE, bitsPerInch: REAL ← 384.0];
END.