DIRECTORY PrincOps USING [BBptr, BBTableSpace, CharEntry, TextBltArg, TextBltFontHandle, TextBltResult], PrincOpsUtils USING [AlignedBBTable, BITBLT], SoftwareTextBlt USING []; TextBltImpl: PROGRAM IMPORTS PrincOpsUtils EXPORTS SoftwareTextBlt = BEGIN TextBlt: PUBLIC PROC [index: CARDINAL, bitPos: CARDINAL, micaPos: CARDINAL, count: INTEGER, ptr: POINTER TO PrincOps.TextBltArg] RETURNS [ newIndex: CARDINAL, newBitPos: CARDINAL, newMicaPos: CARDINAL, newCount: INTEGER, result: PrincOps.TextBltResult] = { bbtablespace: PrincOps.BBTableSpace; bb: PrincOps.BBptr = PrincOpsUtils.AlignedBBTable[@bbtablespace]; font: PrincOps.TextBltFontHandle = ptr.font; UNTIL index > ptr.last DO FetchChar: PROC RETURNS [CHAR] = INLINE {RETURN[ptr.text[index]]}; BitWidth: PROC RETURNS [CARDINAL] = INLINE {RETURN[font.font.widths[char]]}; Height: PROC RETURNS [CARDINAL] = INLINE {RETURN[font.height]}; MicaWidth: PROC RETURNS [CARDINAL] = INLINE {RETURN[font.font.char[char].mica]}; Pad: PROC RETURNS [BOOL] = INLINE {RETURN[font.rgflags[char].pad]}; Stop: PROC RETURNS [BOOL] = INLINE {RETURN[font.rgflags[char].stop]}; char: CHAR = FetchChar[]; IF ptr.function = resolve THEN ptr.coord[index] _ bitPos; IF Stop[] THEN GOTO Quit; IF micaPos + MicaWidth[] > ptr.margin THEN GOTO Margin; IF ptr.function = display THEN DisplayChar[ptr, bitPos, char, bb]; bitPos _ bitPos + BitWidth[]; micaPos _ micaPos + MicaWidth[]; IF Pad[] THEN { count _ count + 1; IF ptr.function # format THEN { bitPos _ bitPos + ptr.space; IF count <= 0 THEN bitPos _ bitPos + 1; }; }; index _ index + 1; REPEAT Quit => result _ stop; Margin => result _ margin; FINISHED => result _ normal; ENDLOOP; RETURN[index, bitPos, micaPos, count, result] }; DisplayChar: PROC [ptr: POINTER TO PrincOps.TextBltArg, bitPos: CARDINAL, char: CHAR, bb: PrincOps.BBptr] = { font: PrincOps.TextBltFontHandle = ptr.font; ce: LONG POINTER TO PrincOps.CharEntry = @font.font.char[char]; KernLeftWidth: PROC RETURNS [CARDINAL] = INLINE {RETURN[LOOPHOLE[ce.leftKern]]}; KernRightWidth: PROC RETURNS [CARDINAL] = INLINE {RETURN[LOOPHOLE[ce.rightKern]]}; bitPos _ bitPos - KernLeftWidth[]; bb.dst _ [word: ptr.dst + bitPos/16, reserved: 0, bit: bitPos MOD 16]; bb.dstBpl _ INTEGER[ptr.dstBpl]; bb.src _ [word: @font.font.bits[ce.offset], reserved: 0, bit: 0]; bb.srcDesc.srcBpl _ bb.width _ font.font.widths[char] + KernLeftWidth[] + KernRightWidth[]; bb.height _ font.height; bb.flags _ [ direction: forward, disjoint: TRUE, disjointItems: TRUE, gray: FALSE, srcFunc: null, dstFunc: or, reserved: 0 ]; bb.reserved _ 0; PrincOpsUtils.BITBLT[bb]; }; END. ¦TextBltImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Levin, April 11, 1983 9:48 am Russ Atkinson (RRA) January 29, 1985 1:21:48 am PST Κ2˜codešœ™Kšœ Οmœ1™žœ˜FKšœ žœ ˜ K˜AK˜[K˜˜ Kšœžœžœ˜8Kšœžœ)˜4Kšœ˜—K˜Kšœžœ˜Kšœ˜K˜—Kšžœ˜—…— (