IKOps.mesa
Copyright © 1987 by Xerox Corporation. All rights reserved.
Adams, January 19, 1987 3:30:09 pm PST
Rick Beach, January 25, 1987 11:51:14 am PST
DIRECTORY
FS USING [OpenFile],
Rope USING [ROPE],
IKFontFormat USING [PointType],
Imager USING [Context],
ImagerPath USING [MoveToProc, LineToProc, CurveToProc, Outline];
IKOps: CEDAR DEFINITIONS
~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
CharacterInfo: TYPE ~ RECORD [
characterCode: CARDINAL ← 0,
characterTypeCode: CARDINAL ← 0,
numberOfDigitizations: NAT ← 0,
totalSetWidth: INTEGER ← 0,
leftSideBearing: INTEGER ← 0,
width: INTEGER ← 0,
rightSideBearing: INTEGER ← 0,
xMin: INTEGER ← 0,
xMax: INTEGER ← 0,
yMin: INTEGER ← 0,
yMax: INTEGER ← 0,
unit: NAT ← 0,
byteOffsetOfContourIndex: INT ← 0,
numberOfContours: NAT ← 0
];
Direction: TYPE ~ {counterclockwise, clockwise};
ContourInfo: TYPE ~ RECORD [
byteOffsetOfImageInformation: INT,
direction: Direction,
nesting: CARDINAL,
colorInside: CARDINAL,
numberOfDigitizations: NAT
];
IKFontData: TYPE ~ REF IKFontDataRep;
IKFontDataRep: TYPE ~ RECORD [
base: ROPE,
nameSectionOffset: INT,
fontInfoSectionOffset: INT,
characterIndexSectionOffset: INT,
characterIndexSectionEnd: INT,
bodySize: REAL,
minCharCode: CARDINAL, -- smallest character code in file
charIndex: CharIndex
];
CharIndex: TYPE ~ REF CharIndexRep;
ByteOffsetOfCharacterData: TYPE ~ INT;
CharIndexRep: TYPE ~ RECORD [
SEQUENCE size: CARDINAL OF ByteOffsetOfCharacterData
];
RealSeq: TYPE ~ REF RealSeqRep;
RealSeqRep: TYPE ~ RECORD [
length: NAT ← 0,
v: SEQUENCE maxLength: NAT OF REAL
];
PointType: TYPE ~ IKFontFormat.PointType;
{none, start, corner, curve, tangent};
TypeSeq: TYPE ~ REF TypeSeqRep;
TypeSeqRep: TYPE ~ RECORD [
length: NAT ← 0,
v: SEQUENCE maxLength: NAT OF PointType
];
Open: PROC [fileName: ROPE] RETURNS [IKFontData];
OpenFromOpenFile: PROC [file: FS.OpenFile] RETURNS [IKFontData];
GetFileName: PROC [ik: IKFontData] RETURNS [ROPE];
GetFontName: PROC [ik: IKFontData] RETURNS [ROPE];
Contains: PROC [ik: IKFontData, code: CARDINAL] RETURNS [BOOL];
EnumerateCharacters: PROC [ik: IKFontData, action: PROC [characterCode: CARDINAL, byteOffsetOfCharacterData: INT]];
GetCharacterInfo: PROC [ik: IKFontData, code: CARDINAL] RETURNS [CharacterInfo];
GetContourInfo: PROC [ik: IKFontData, byteOffsetOfContourIndex: INT, contourNumber: NAT] RETURNS [ContourInfo];
GetContourDigitizations: PROC [ik: IKFontData, contourInfo: ContourInfo, x, y: RealSeq, type: TypeSeq];
ShowPts: PROC [ik: IKFontData, code: CARDINAL, context: Imager.Context];
GetPath: PROC [ik: IKFontData, code: CARDINAL, moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc, curveTo: ImagerPath.CurveToProc];
GetOutline: PROC [ik: IKFontData, code: CARDINAL] RETURNS [ImagerPath.Outline];
END.