PrePressFontFormat.mesa
Copyright Ó 1984, 1985, 1986, 1989, 1991 by Xerox Corporation. All rights reserved.
Doug Wyatt, March 7, 1985 2:32:05 pm PST
Michael Plass, December 15, 1986 4:35:53 pm PST
Tim Diebert, April 20, 1989 9:33:16 am PDT
PrePressFontFormat: CEDAR DEFINITIONS
~ BEGIN
BcplReal: TYPE ~ RECORD[CARD32];
A BCPL floating point number; use RealConvert to convert to Mesa REAL.
IXType: TYPE ~ MACHINE DEPENDENT {
end(0), -- end of index part
name(1), -- NameIndexEntry follows
spline(2), -- StdIndexEntry follows
character(3), -- CharacterIndexEntry follows
width(4), -- StdIndexEntry follows
orbit(5), -- CharacterIndexEntry follows
multipleCharacter(6), -- MultipleCharacterIndexEntry follows
(17B)
};
IXHeader: TYPE ~ WORD16 MACHINE DEPENDENT RECORD [
type(0:0..3): IXType, -- type of entry
length(0:4..15): [0..7777B] -- length of entry, including this header
];
NameIndexEntry: TYPE ~ WORD16 MACHINE DEPENDENT RECORD [ -- ix.type = name
code(0:0..15): CARD16, -- numeric code for this name
chars(1): PACKED ARRAY[0..20) OF BYTE -- name as a BCPL string: first byte is length
];
StdIndexEntry: TYPE ~ MACHINE DEPENDENT RECORD [ -- ix.type = spline, width
family(0:0..7): BYTE, -- family name, using a name code
face(0:8..15): BYTE, -- face encoding
bc(0:16..23): BYTE, -- beginning character
ec(0:24..31): BYTE, -- ending character
size(1:0..15): CARD16, -- size in micas
rotation(1:16..31): CARD16, -- rotation in minutes of arc anticlockwise
segmentSA(2:0..31): CARD32, -- starting address in file of the segment (in words!)
segmentLength(3:0..31): CARD32 -- length of the segment (in words!)
];
CharacterIndexEntry: TYPE ~ MACHINE DEPENDENT RECORD [ -- ix.type = character, orbit
family(0:0..7): BYTE, -- family name, using a name code
face(0:8..15): BYTE, -- face encoding
bc(0:16..23): BYTE, -- beginning character
ec(0:24..31): BYTE, -- ending character
size(1:0..15): CARD16, -- size in micas
rotation(1:16..31): CARD16, -- rotation in minutes of arc anticlockwise
segmentSA(2:0..31): CARD32, -- starting address in file of the segment (in words!)
segmentLength(3:0..31): CARD32, -- length of the segment (in words!)
resolutionX(4:0..15): CARD16, -- 10 * resolution in scan lines per inch
resolutionY(4:16..31): CARD16 -- 10 * resolution in bits per inch
];
MultipleCharacterIndexEntry: TYPE ~ MACHINE DEPENDENT RECORD [ -- ix.type=multipleCharacter
family(0:0..7): BYTE, -- family name, using a name code
face(0:8..15): BYTE, -- face encoding
bc(0:16..23): BYTE, -- beginning character
ec(0:24..31): BYTE, -- ending character
size(1:0..15): CARD16, -- size in micas
rotation(1:16..31): CARD16, -- rotation in minutes of arc anticlockwise
resolutionX(2:0..15): CARD16, -- 10 * resolution in scan lines per inch
resolutionY(2:16..31): CARD16, -- 10 * resolution in bits per inch
numSegs(3:0..15): CARD16, -- number of segments
ws(3:16..31): CARD16 ¬ 0
-- segs: ARRAY[0..numSegs) OF DatedSegmentEntry
];
DatedSegmentEntry: TYPE ~ MACHINE DEPENDENT RECORD [
segmentSA(0:0..31): CARD32,
segmentLength(1:0..31): CARD32,
expirationDate(2:0..31): CARD32
];
CharacterSegment: TYPE ~ RECORD[
charData: CharacterDataArray[ec-bc+1],
directory: DirectoryArray[ec-bc+1]
-- followed by rasters, pointed to by the directory
];
CharacterData: TYPE ~ MACHINE DEPENDENT RECORD [
wx(0:0..31): INT32, -- x width (signed fraction)
wy(1:0..31): INT32, -- y width (signed fraction)
bbox(2:0..15): INT16, -- x offset for bounding box
bboy(2:16..31): INT16, -- y offset for bounding box
bbdx(3:0..15): INT16, -- width of bounding box (scan lines)
bbdy(3:16..31): INT16 -- height of bounding box (bits) or missingCharacter
];
missingCharacter: INT16 ~ -1;
value of bbdx in CharacterData for a missing character
CharDataArray: TYPE ~ RECORD [SEQUENCE COMPUTED CARD16 OF CharacterData];
RelFilePos: TYPE ~ INT32;
missingFilePos: RelFilePos ~ LOOPHOLE[INT.LAST];
DirectoryArray: TYPE ~ RECORD [SEQUENCE COMPUTED CARD16 OF RelFilePos];
RasterDefn: TYPE ~ WORD16 MACHINE DEPENDENT RECORD [
raster(0:0..5): [0..77B], -- words per scan line
lines(0:6..15): [0..1777B] -- number of scan lines
-- bits: ARRAY[0..lines) OF ARRAY[0..raster) OF WORD
];
WidthSegment: TYPE ~ MACHINE DEPENDENT RECORD [
fbbox(0:0..15): INT16, -- x offset for font bounding box
fbboy(0:16..31): INT16, -- y offset for font bounding box
fbbdx(1:0..15): INT16, -- x width for font bounding box
fbbdy(1:16..31): INT16, -- y height for font bounding box
xWidthFixed(2:0..0): [0..1], -- 1 if all x widths equal
yWidthFixed(2:1..1): [0..1], -- 1 if all y widths equal
spare(2:2..31): [0..3FFFFFFFh] -- unused
-- xwidths: WidthArray[IF xWidthFixed THEN 1 ELSE ec-bc+1]
-- ywidths: WidthArray[IF yWidthFixed THEN 1 ELSE ec-bc+1]
];
WidthArray: TYPE ~ RECORD [SEQUENCE COMPUTED CARD16 OF INT16];
missingWidth: INT16 ~ -32768 ; -- LOOPHOLE[100000B];
value of WidthArray entry for a missing character
SplineSegment: TYPE ~ RECORD [
splineData: SplineDataArray[ec-bc+1],
directory: DirectoryArray[ec-bc+1]
-- followed by spline codes, pointed to by the directory
];
SplineData: TYPE ~ MACHINE DEPENDENT RECORD [
wx(0:0..31): BcplReal, -- width in x direction or missingSpline
wy(1:0..31): BcplReal, -- width in y direction
xmin(2:0..31): BcplReal, -- left edge of bounding box
ymin(3:0..31): BcplReal, -- bottom edge of bounding box
xmax(4:0..31): BcplReal, -- right edge of bounding box
ymax(5:0..31): BcplReal -- top edge of bounding box
];
missingSpline: BcplReal ~ LOOPHOLE[CARD32[CARD16.LAST]];
value of wx in SplineData for a missing character
SplineDataArray: TYPE ~ RECORD[SEQUENCE COMPUTED CARD16 OF SplineData];
SplineCode: TYPE ~ MACHINE DEPENDENT {
moveTo(1), drawTo(2), drawCurve(3),
endDefinition(177776B), newObject(177777B)
};
SplineCommand: TYPE ~ MACHINE DEPENDENT RECORD [code: SplineCode];
SplineCoords: TYPE ~ MACHINE DEPENDENT RECORD [
x(0:0..31): BcplReal,
y(1:0..31): BcplReal
];
END.