-- file: TFtoPLDoSimpleImpl.mesa
-- Pascal-to-Mesa translator output, translated at September 23, 1986 1:04:35 pm PDT


DIRECTORY
  PascalBasic,
  PascalWizardFiles,
  TFtoPLPrivate,
  TFtoPLExternals,
  TFtoPLMain;

TFtoPLDoSimpleImpl: PROGRAM IMPORTS PascalWizardFiles, TFtoPLPrivate, TFtoPLMain EXPORTS TFtoPLPrivate = PUBLIC
BEGIN OPEN PascalBasic, PascalWizardFiles, TFtoPLPrivate, TFtoPLExternals, TFtoPLMain;
 CheckTheFixWordEntries: PROCEDURE = 
BEGIN I:PascalInteger[0..32767];
 IF( INT[Tfm↑[4*WidthBase]]>0)OR ( INT[Tfm↑[4*WidthBase+1]]>0)OR ( INT[Tfm↑[
4*WidthBase+2]]>0)OR ( INT[Tfm↑[4*WidthBase+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: "width[0] should be zero."]; PascalWriteLn[file: @Output]}; END;
IF( INT[Tfm↑[4*HeightBase]]>0)OR ( INT[Tfm↑[4*HeightBase+1]]>0)OR ( INT[Tfm↑[4*HeightBase+2
]]>0)OR ( INT[Tfm↑[4*HeightBase+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: "height[0] should be zero."]; PascalWriteLn[file: @Output]}; END;
IF( INT[Tfm↑[4*DepthBase]]>0)OR ( INT[Tfm↑[4*DepthBase+1]]>0)OR ( INT[Tfm↑[4*DepthBase+2]]>0
)OR ( INT[Tfm↑[4*DepthBase+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: "depth[0] should be zero."]; PascalWriteLn[file: @Output]}; END;
IF( INT[Tfm↑[4*ItalicBase]]>0)OR ( INT[Tfm↑[4*ItalicBase+1]]>0)OR ( INT[Tfm↑[4*ItalicBase+2
]]>0)OR ( INT[Tfm↑[4*ItalicBase+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: "italic[0] should be zero."]; PascalWriteLn[file: @Output]}; END;
FOR i:INT    IN [ INT[0 ].. INT[Nw-1 ]] DO  I ← i; IF( INT[Tfm↑[4*(WidthBase+I)]]>0)AND ( INT[Tfm↑[4*(WidthBase+I)]
]<255) THEN BEGIN Tfm↑[4*(WidthBase+I)]←0;Tfm↑[(4*(WidthBase+I))+1]←0;
Tfm↑[(4*(WidthBase+I))+2]←0;Tfm↑[(4*(WidthBase+I))+3]←0;
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: "Width"]; PascalWriteLongString[file: @Output, item: " "]; PascalWriteInteger[file: @Output, item: I, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: " is too big;"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I have set it to zero."]; PascalWriteLn[file: @Output]}; END ENDLOOP;
FOR i:INT    IN [ INT[0 ].. INT[Nh-1 ]] DO  I ← i; IF( INT[Tfm↑[4*(HeightBase+I)]]>0)AND ( INT[Tfm↑[4*(HeightBase+I
)]]<255) THEN BEGIN Tfm↑[4*(HeightBase+I)]←0;
Tfm↑[(4*(HeightBase+I))+1]←0;Tfm↑[(4*(HeightBase+I))+2]←0;
Tfm↑[(4*(HeightBase+I))+3]←0;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: "Height"]; PascalWriteLongString[file: @Output, item: " "]; PascalWriteInteger[file: @Output, item: I, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: " is too big;"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I have set it to zero."]; PascalWriteLn[file: @Output]}; END ENDLOOP;
FOR i:INT    IN [ INT[0 ].. INT[Nd-1 ]] DO  I ← i; IF( INT[Tfm↑[4*(DepthBase+I)]]>0)AND ( INT[Tfm↑[4*(DepthBase+I)]
]<255) THEN BEGIN Tfm↑[4*(DepthBase+I)]←0;Tfm↑[(4*(DepthBase+I))+1]←0;
Tfm↑[(4*(DepthBase+I))+2]←0;Tfm↑[(4*(DepthBase+I))+3]←0;
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: "Depth"]; PascalWriteLongString[file: @Output, item: " "]; PascalWriteInteger[file: @Output, item: I, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: " is too big;"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I have set it to zero."]; PascalWriteLn[file: @Output]}; END ENDLOOP;
FOR i:INT    IN [ INT[0 ].. INT[Ni-1 ]] DO  I ← i; IF( INT[Tfm↑[4*(ItalicBase+I)]]>0)AND ( INT[Tfm↑[4*(ItalicBase+I
)]]<255) THEN BEGIN Tfm↑[4*(ItalicBase+I)]←0;
Tfm↑[(4*(ItalicBase+I))+1]←0;Tfm↑[(4*(ItalicBase+I))+2]←0;
Tfm↑[(4*(ItalicBase+I))+3]←0;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: "Italic correction"]; PascalWriteLongString[file: @Output, item: " "]; PascalWriteInteger[file: @Output, item: I, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: " is too big;"]; PascalWriteLn[file: @Output]};
 END;{PascalWriteLongString[file: @Output, item: "I have set it to zero."]; PascalWriteLn[file: @Output]}; END ENDLOOP;
IF  INT[Nk]>0  THEN FOR i:INT    IN [ INT[0 ].. INT[Nk-1 ]] DO  I ← i; IF( INT[Tfm↑[4*(KernBase+I)]]>0)AND ( INT[Tfm↑[4*(
KernBase+I)]]<255) THEN BEGIN Tfm↑[4*(KernBase+I)]←0;
Tfm↑[(4*(KernBase+I))+1]←0;Tfm↑[(4*(KernBase+I))+2]←0;
Tfm↑[(4*(KernBase+I))+3]←0;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"]; PascalWriteLongString[file: @Output, item: " "]; PascalWriteInteger[file: @Output, item: I, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: " is too big;"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I have set it to zero."]; PascalWriteLn[file: @Output]}; END ENDLOOP; END; DoSimpleThings: PROCEDURE
 = 
BEGIN I:PascalInteger[0..32767];--48:----62:-- BEGIN FontType←0;IF  INT[Lh]>=12  THEN BEGIN--53:
BEGIN CheckBcpl[32,40];
IF(Tfm↑[32]=10)AND (Tfm↑[33]=84)AND (Tfm↑[34]=69)AND (Tfm↑[35]=88)AND (
Tfm↑[36]=32)AND (Tfm↑[37]=77)AND (Tfm↑[38]=65)AND (Tfm↑[39]=84)AND (Tfm↑[40]=72) THEN
BEGIN IF(Tfm↑[41]=83)AND (Tfm↑[42]=89) THEN FontType←1  ELSE IF(Tfm↑[41]=69)
AND (Tfm↑[42]=88) THEN FontType←2; END; END--:53--;IF  INT[Lh]>=17  THEN BEGIN--55:
Left[];PascalWriteLongString[file: @PlFile, item: "FAMILY"];CheckBcpl[72,20];OutBcpl[72];Right--:55--[];
IF  INT[Lh]>=18  THEN--56:--BEGIN Left[];PascalWriteLongString[file: @PlFile, item: "FACE"];OutFace[95];Right[];
FOR i:INT    IN [ INT[18 ].. INT[Lh-1 ]] DO  I ← i;  Left[];{PascalWriteLongString[file: @PlFile, item: "HEADER D "]; PascalWriteInteger[file: @PlFile, item: I, fieldMinLength: 1]};
OutOctal[24+ INT[4]*I,4];Right[]; ENDLOOP; END--:56--; END;--54:--Left[];
PascalWriteLongString[file: @PlFile, item: "CODINGSCHEME"];OutBcpl[32];Right--:54--[]; END;--51:--Left[];
PascalWriteLongString[file: @PlFile, item: "DESIGNSIZE"];IF  INT[Lh]<2  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: "Design size "]; PascalWriteLongString[file: @Output, item: "missing"]; PascalWriteLongString[file: @Output, item: "!"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I've set it to 10 points."]; PascalWriteLn[file: @Output]};PascalWriteLongString[file: @PlFile, item: " D 10"];
 END  ELSE IF  INT[Tfm↑[28]]>127  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: "Design size "]; PascalWriteLongString[file: @Output, item: "negative"]; PascalWriteLongString[file: @Output, item: "!"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I've set it to 10 points."]; PascalWriteLn[file: @Output]};PascalWriteLongString[file: @PlFile, item: " D 10"];
 END  ELSE IF(Tfm↑[28]=0)AND ( INT[Tfm↑[29]]<16) 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: "Design size "]; PascalWriteLongString[file: @Output, item: "too small"]; PascalWriteLongString[file: @Output, item: "!"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I've set it to 10 points."]; PascalWriteLn[file: @Output]};PascalWriteLongString[file: @PlFile, item: " D 10"];
 END  ELSE OutFix[28];Right[];
PascalWriteLongString[file: @PlFile, item: "(COMMENT DESIGNSIZE IS IN POINTS)"];OutLn[];
PascalWriteLongString[file: @PlFile, item: "(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)"];
OutLn--:51--[];--49:--Left[];PascalWriteLongString[file: @PlFile, item: "CHECKSUM"];
IF Lh=0  THEN PascalWriteLongString[file: @PlFile, item: " O 0"] ELSE OutOctal[24,4];Right--:49--[];--57:
IF( INT[Lh]>17)AND ( INT[Tfm↑[92]]>127) THEN BEGIN Left[];
PascalWriteLongString[file: @PlFile, item: "SEVENBITSAFEFLAG TRUE"];Right[]; END--:57--; END--:48--;--58:
IF  INT[Np]>0  THEN BEGIN Left[];PascalWriteLongString[file: @PlFile, item: "FONTDIMEN"];OutLn[];
FOR i:INT    IN [ INT[1 ].. INT[Np ]] DO --60:--I ← i;  Left[];
IF I=1  THEN PascalWriteLongString[file: @PlFile, item: "SLANT"] ELSE BEGIN IF( INT[Tfm↑[4*(ParamBase+I)]]>0)
AND ( INT[Tfm↑[4*(ParamBase+I)]]<255) THEN BEGIN Tfm↑[4*(ParamBase+I)]←0;
Tfm↑[(4*(ParamBase+I))+1]←0;Tfm↑[(4*(ParamBase+I))+2]←0;
Tfm↑[(4*(ParamBase+I))+3]←0;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: "Parameter "]; PascalWriteLongString[file: @Output, item: " "]; PascalWriteInteger[file: @Output, item: I, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: " is too big;"]; PascalWriteLn[file: @Output]}; END;
{PascalWriteLongString[file: @Output, item: "I have set it to zero."]; PascalWriteLn[file: @Output]}; END;--61:
IF  INT[I]<=7  THEN SELECT I FROM 2 =>PascalWriteLongString[file: @PlFile, item: "SPACE"];
3 =>PascalWriteLongString[file: @PlFile, item: "STRETCH"];4 =>PascalWriteLongString[file: @PlFile, item: "SHRINK"];
5 =>PascalWriteLongString[file: @PlFile, item: "XHEIGHT"];6 =>PascalWriteLongString[file: @PlFile, item: "QUAD"];
7 =>PascalWriteLongString[file: @PlFile, item: "EXTRASPACE"]; ENDCASE  ELSE IF( INT[I]<=22)AND (FontType=1) THEN SELECT
I FROM 8 =>PascalWriteLongString[file: @PlFile, item: "NUM1"];9 =>PascalWriteLongString[file: @PlFile, item: "NUM2"];
10 =>PascalWriteLongString[file: @PlFile, item: "NUM3"];11 =>PascalWriteLongString[file: @PlFile, item: "DENOM1"];
12 =>PascalWriteLongString[file: @PlFile, item: "DENOM2"];13 =>PascalWriteLongString[file: @PlFile, item: "SUP1"];
14 =>PascalWriteLongString[file: @PlFile, item: "SUP2"];15 =>PascalWriteLongString[file: @PlFile, item: "SUP3"];
16 =>PascalWriteLongString[file: @PlFile, item: "SUB1"];17 =>PascalWriteLongString[file: @PlFile, item: "SUB2"];
18 =>PascalWriteLongString[file: @PlFile, item: "SUPDROP"];19 =>PascalWriteLongString[file: @PlFile, item: "SUBDROP"];
20 =>PascalWriteLongString[file: @PlFile, item: "DELIM1"];21 =>PascalWriteLongString[file: @PlFile, item: "DELIM2"];
22 =>PascalWriteLongString[file: @PlFile, item: "AXISHEIGHT"]; ENDCASE  ELSE IF( INT[I]<=13)AND (FontType=2) THEN IF
I=8  THEN PascalWriteLongString[file: @PlFile, item: "DEFAULTRULETHICKNESS"] ELSE {
PascalWriteLongString[file: @PlFile, item: "BIGOPSPACING"]; PascalWriteInteger[file: @PlFile, item: I-8, fieldMinLength: 1]} ELSE {PascalWriteLongString[file: @PlFile, item: "PARAMETER D "]; PascalWriteInteger[file: @PlFile, item: I, fieldMinLength: 1]--:61--}; END;
OutFix[4*(ParamBase+I)];Right[];--:60-- ENDLOOP;Right[]; END;--59:
IF(FontType=1)AND (Np#22) THEN {
PascalWriteLongString[file: @Output, item: "Unusual number of fontdimen parameters for a MATHSY font ("]; PascalWriteInteger[file: @Output, item: Np, fieldMinLength: 1]
; PascalWriteLongString[file: @Output, item: " not 22)."]; PascalWriteLn[file: @Output]} ELSE IF(FontType=2)AND (Np#13) THEN {
PascalWriteLongString[file: @Output, item: "Unusual number of fontdimen parameters for a MATHEX font ("]; PascalWriteInteger[file: @Output, item: Np, fieldMinLength: 1]
; PascalWriteLongString[file: @Output, item: " not 13)."]--:59--; PascalWriteLn[file: @Output]};--:58--CheckTheFixWordEntries[];--:62-- END;--:86

END.