-- file: TFtoPLDoCharactersImpl.mesa -- Pascal-to-Mesa translator output, translated at September 14, 1985 3:12:44 pm PDT DIRECTORY PascalBasic, PascalWizardFiles, TFtoPLPrivate, TFtoPLExternals, TFtoPLMain; TFtoPLDoCharactersImpl: PROGRAM IMPORTS PascalWizardFiles, TFtoPLPrivate, TFtoPLMain EXPORTS TFtoPLPrivate = PUBLIC BEGIN OPEN PascalBasic, PascalWizardFiles, TFtoPLPrivate, TFtoPLExternals, TFtoPLMain; --87:-- DoCharacters: PROCEDURE = BEGIN C:Byte;K:Index;--76:--SortPtr←0; FOR i:INT IN [ INT[Bc ].. INT[Ec ]] DO C ← i; IF INT[Tfm↑[4*(CharBase+C)]]>0 THEN BEGIN IF CharsOnLine =8 THEN BEGIN {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};CharsOnLine←1; END ELSE BEGIN IF INT[CharsOnLine]>0 THEN PascalWriteLongString[file: @Output, item: " "]; CharsOnLine←CharsOnLine+1; END;PrintOctal[C];Left[]; PascalWriteLongString[file: @PlFile, item: "CHARACTER"];OutChar[C];OutLn[];--77:--BEGIN Left[]; PascalWriteLongString[file: @PlFile, item: "CHARWD"]; IF INT[Tfm↑[4*(CharBase+C)]]>=Nw THEN BEGIN Perfect←FALSE;{PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Width"]; PascalWriteLongString[file: @Output, item: " index for character "]};PrintOctal[C]; {PascalWriteLongString[file: @Output, item: " is too large;"]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "so I reset it to zero."]; PascalWriteLn[file: @Output]}; END ELSE OutFix[4*(WidthBase+Tfm↑[4*(CharBase+C)])];Right[]; END--:77--; IF INT[( Tfm↑[4*(CharBase+C)+1]/16)]>0 THEN--78: IF INT[( Tfm↑[4*(CharBase+C)+1]/16)]>=Nh THEN BEGIN Perfect←FALSE; {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "Height"]; PascalWriteLongString[file: @Output, item: " index for character "]};PrintOctal[C]; {PascalWriteLongString[file: @Output, item: " is too large;"]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "so I reset it to zero."]; PascalWriteLn[file: @Output]}; END ELSE BEGIN Left[];PascalWriteLongString[file: @PlFile, item: "CHARHT"]; OutFix[4*(HeightBase+( Tfm↑[4*(CharBase+C)+1]/16))];Right[]; END--:78--; IF INT[( Tfm↑[4*(CharBase+C)+1]MOD 16)]>0 THEN--79: IF INT[( Tfm↑[4*(CharBase+C)+1]MOD 16)]>=Nd THEN BEGIN Perfect←FALSE; {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "Depth"]; PascalWriteLongString[file: @Output, item: " index for character "]};PrintOctal[C]; {PascalWriteLongString[file: @Output, item: " is too large;"]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "so I reset it to zero."]; PascalWriteLn[file: @Output]}; END ELSE BEGIN Left[];PascalWriteLongString[file: @PlFile, item: "CHARDP"]; OutFix[4*(DepthBase+( Tfm↑[4*(CharBase+C)+1]MOD 16))];Right[]; END--:79--; IF INT[( Tfm↑[4*(CharBase+C)+2]/4)]>0 THEN--80: IF INT[( Tfm↑[4*(CharBase+C)+2]/4)]>=Ni THEN BEGIN Perfect←FALSE; {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "Italic correction"]; PascalWriteLongString[file: @Output, item: " index for character "]}; PrintOctal[C];{PascalWriteLongString[file: @Output, item: " is too large;"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "so I reset it to zero."]; PascalWriteLn[file: @Output]}; END ELSE BEGIN Left[]; PascalWriteLongString[file: @PlFile, item: "CHARIC"]; OutFix[4*(ItalicBase+( Tfm↑[4*(CharBase+C)+2]/4))];Right[]; END--:80--; SELECT( Tfm↑[4*(CharBase+C)+2]MOD 4)FROM 0 => NULL;1 =>--81:--BEGIN Left[]; PascalWriteLongString[file: @PlFile, item: "COMMENT"];OutLn[];I←Tfm↑[4*(CharBase+C)+3];Active←TRUE; DO--72:--BEGIN K←4*(LigKernBase+I);IF INT[Tfm↑[K+2]]>=128 THEN--73: BEGIN IF(( INT[Tfm↑[K+1]]<Bc)OR ( INT[Tfm↑[K+1]]>Ec)OR (Tfm↑[4*(CharBase+Tfm↑[K+1])]=0)) THEN BEGIN Perfect←FALSE;IF INT[CharsOnLine]>0 THEN {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]}; CharsOnLine←0; {PascalWriteLongString[file: @Output, item: "Bad TFM file: "]; PascalWriteLongString[file: @Output, item: "Kern step for"]; PascalWriteLongString[file: @Output, item: " nonexistent character "]}; PrintOctal[Tfm↑[K+1]];{PascalWriteLongString[file: @Output, item: "."]; PascalWriteLn[file: @Output]}; END ELSE BEGIN Left[]; PascalWriteLongString[file: @PlFile, item: "KRN"];OutChar[Tfm↑[K+1]]; IF INT[Tfm↑[K+3]]>=Nk THEN BEGIN BEGIN Perfect←FALSE; IF INT[CharsOnLine]>0 THEN {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};CharsOnLine←0; {PascalWriteLongString[file: @Output, item: "Bad TFM file: "]; PascalWriteLongString[file: @Output, item: "Kern index too large."]; PascalWriteLn[file: @Output]}; END; PascalWriteLongString[file: @PlFile, item: " R 0.0"]; END ELSE OutFix[4*(KernBase+Tfm↑[K+3])];Right[]; END; END--:73-- ELSE--74: BEGIN IF(( INT[Tfm↑[K+1]]<Bc)OR ( INT[Tfm↑[K+1]]>Ec)OR (Tfm↑[4*(CharBase+Tfm↑[K+1])]=0)) THEN BEGIN Perfect←FALSE;IF INT[CharsOnLine]>0 THEN {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]}; CharsOnLine←0; {PascalWriteLongString[file: @Output, item: "Bad TFM file: "]; PascalWriteLongString[file: @Output, item: "Ligature step for"]; PascalWriteLongString[file: @Output, item: " nonexistent character "]}; PrintOctal[Tfm↑[K+1]];{PascalWriteLongString[file: @Output, item: "."]; PascalWriteLn[file: @Output]}; END; IF(( INT[Tfm↑[K+3]]<Bc)OR ( INT[Tfm↑[K+3]]>Ec)OR (Tfm↑[4*(CharBase+Tfm↑[K+3])]=0)) THEN BEGIN Perfect←FALSE;IF INT[CharsOnLine]>0 THEN {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]}; CharsOnLine←0;{PascalWriteLongString[file: @Output, item: "Bad TFM file: "]; PascalWriteLongString[file: @Output, item: "Ligature step produces the"] ; PascalWriteLongString[file: @Output, item: " nonexistent character "]};PrintOctal[Tfm↑[K+3]];{PascalWriteLongString[file: @Output, item: "."]; PascalWriteLn[file: @Output]}; END ELSE BEGIN Left[];PascalWriteLongString[file: @PlFile, item: "LIG"];OutChar[Tfm↑[K+1]]; OutChar[Tfm↑[K+3]];Right[]; END; END--:74--; IF INT[Tfm↑[K]]>=128 THEN BEGIN IF INT[SortPtr]>0 THEN BEGIN PascalWriteLongString[file: @PlFile, item: "(STOP)"];OutLn[];IF INT[Level]>1 THEN Right[]; END;Active←FALSE; END; END--:72--; I←I+1; IF Active=FALSE THEN EXIT; ENDLOOP;Right[]; END--:81--;2 =>--82: BEGIN R←Tfm↑[4*(CharBase+C)+3]; IF(( INT[R]<Bc)OR ( INT[R]>Ec)OR (Tfm↑[4*(CharBase+R)]=0)) THEN BEGIN BEGIN Perfect← FALSE;IF INT[CharsOnLine]>0 THEN {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};CharsOnLine←0; {PascalWriteLongString[file: @Output, item: "Bad TFM file: "]; PascalWriteLongString[file: @Output, item: "Character list link to"] ; PascalWriteLongString[file: @Output, item: " nonexistent character "]};PrintOctal[R];{PascalWriteLongString[file: @Output, item: "."]; PascalWriteLn[file: @Output]}; END; Tfm↑[4*(CharBase+C)+2]←4*( Tfm↑[4*(CharBase+C)+2]/4)+0; END ELSE BEGIN WHILE( INT[R]<C)AND (( Tfm↑[4*(CharBase+R)+2]MOD 4)=2)DO R←Tfm↑[4 *(CharBase+R)+3] ENDLOOP ;IF R=C THEN BEGIN BEGIN Perfect←FALSE; IF INT[CharsOnLine]>0 THEN {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};CharsOnLine←0; {PascalWriteLongString[file: @Output, item: "Bad TFM file: "]; PascalWriteLongString[file: @Output, item: "Cycle in a character list!"]; PascalWriteLn[file: @Output]}; END; PascalWriteLongString[file: @Output, item: "Character "];PrintOctal[C];{PascalWriteLongString[file: @Output, item: " now ends the list."]; PascalWriteLn[file: @Output]}; Tfm↑[4*(CharBase+C)+2]←4*( Tfm↑[4*(CharBase+C)+2]/4)+0; END ELSE BEGIN Left[];PascalWriteLongString[file: @PlFile, item: "NEXTLARGER"]; OutChar[Tfm↑[4*(CharBase+C)+3]];Right[]; END; END; END--:82--;3 =>--83: IF INT[Tfm↑[4*(CharBase+C)+3]]>=Ne THEN BEGIN BEGIN Perfect←FALSE; {PascalWriteLongString[file: @Output, item: " "]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "Extensible"]; PascalWriteLongString[file: @Output, item: " index for character "]};PrintOctal[C]; {PascalWriteLongString[file: @Output, item: " is too large;"]; PascalWriteLn[file: @Output]};{PascalWriteLongString[file: @Output, item: "so I reset it to zero."]; PascalWriteLn[file: @Output]}; END; Tfm↑[4*(CharBase+C)+2]←4*( Tfm↑[4*(CharBase+C)+2]/4)+0; END ELSE BEGIN Left[];PascalWriteLongString[file: @PlFile, item: "VARCHAR"];OutLn[];--84: FOR i:INT IN [ INT[0 ].. INT[3 ]] DO K ← i; IF(K=3)OR ( INT[Tfm↑[4*(ExtenBase+Tfm↑[4*(CharBase+C)+3])+K]]>0) THEN BEGIN Left[];SELECT K FROM 0 =>PascalWriteLongString[file: @PlFile, item: "TOP"]; 1 =>PascalWriteLongString[file: @PlFile, item: "MID"];2 =>PascalWriteLongString[file: @PlFile, item: "BOT"];3 =>PascalWriteLongString[file: @PlFile, item: "REP"]; ENDCASE; IF(( INT[Tfm↑[4*(ExtenBase+Tfm↑[4*(CharBase+C)+3])+K]]<Bc)OR ( INT[Tfm↑[4*(ExtenBase +Tfm↑[4*(CharBase+C)+3])+K]]>Ec)OR (Tfm↑[4*(CharBase+Tfm↑[4*(ExtenBase+Tfm ↑[4*(CharBase+C)+3])+K])]=0)) THEN OutChar[C] ELSE OutChar[Tfm↑[4*( ExtenBase+Tfm↑[4*(CharBase+C)+3])+K]];Right[]; END--:84-- ENDLOOP;Right[]; END--:83--; ENDCASE;Right[]; END--:76-- ENDLOOP; END;--:87----88:-- END.