file: TFtoPL.changes
Modified by Lyle Ramshaw, September 23, 1983 3:14 pm
Pavel, September 14, 1985 3:12:11 pm PDT
002416: Change the banner line.
@x
@d banner=='This is TFtoPL, Version 2.4' {printed when the program starts}
@y
@d banner=='This is TFtoPL 2.4 for Cedar 6.0' {printed when the program starts}
@z
003093: Change write←ln to writeln.
@x
@d print←ln(#)==write←ln(#)
@y
@d print←ln(#)==writeln(#)
@d write←ln(#) == writeln(#)
@z
003287: Allow for external procedure and function declarations for things implemented directly in Cedar, rather than in Pascal.
@x
var @<Globals in the outer block@>@/
procedure initialize; {this procedure gets things started properly}
@y
var @<Globals in the outer block@>@/
@<External procedure declarations for things implemented directly in Cedar@>@/
procedure initialize; {this procedure gets things started properly}
@z
004707: Packed file of 0..255 needs an id; call it a byte𡤏ile.
@x
@!tfm𡤏ile:packed file of 0..255;
@y
@!tfm𡤏ile: byte𡤏ile;
@z
005052: Hook up open call to Cedar.
@x
reset(tfm𡤏ile);
@y
byte𡤏ile←reset(tfm𡤏ile, 'tfm ');
@z
017224: Here's a rewrite.
@x
rewrite(pl𡤏ile);
@y
file←rewrite(pl𡤏ile, 'pl ');
@z
036394: Break up a big proc by deleting a big chunk . . . (see also below)
@x
@<Check the |fix←word| entries@>=
if nonzero𡤏ix(4*width�se) then bad('width[0] should be zero.');
@.should be zero@>
if nonzero𡤏ix(4*height�se) then bad('height[0] should be zero.');
if nonzero𡤏ix(4*depth�se) then bad('depth[0] should be zero.');
if nonzero𡤏ix(4*italic�se) then bad('italic[0] should be zero.');
for i:=0 to nw-1 do check𡤏ix(4*(width�se+i))('Width');
@.Width n is too big@>
for i:=0 to nh-1 do check𡤏ix(4*(height�se+i))('Height');
@.Height n is too big@>
for i:=0 to nd-1 do check𡤏ix(4*(depth�se+i))('Depth');
@.Depth n is too big@>
for i:=0 to ni-1 do check𡤏ix(4*(italic�se+i))('Italic correction');
@.Italic correction n is too big@>
if nk>0 then for i:=0 to nk-1 do check𡤏ix(kern(i))('Kern');
@.Kern n is too big@>
@y
@<Check the |fix←word| entries@>=
check←the𡤏ix←word𡤎ntries;
@z
045513: And moving it somewhere else as a separate proc.
@x
@p procedure do←simple←things;
@y
@p procedure check←the𡤏ix←word𡤎ntries;
var i:0..@'77777; {an index to words of a subfile}
begin
if nonzero𡤏ix(4*width�se) then bad('width[0] should be zero.');
@.should be zero@>
if nonzero𡤏ix(4*height�se) then bad('height[0] should be zero.');
if nonzero𡤏ix(4*depth�se) then bad('depth[0] should be zero.');
if nonzero𡤏ix(4*italic�se) then bad('italic[0] should be zero.');
for i:=0 to nw-1 do check𡤏ix(4*(width�se+i))('Width');
@.Width n is too big@>
for i:=0 to nh-1 do check𡤏ix(4*(height�se+i))('Height');
@.Height n is too big@>
for i:=0 to nd-1 do check𡤏ix(4*(depth�se+i))('Depth');
@.Depth n is too big@>
for i:=0 to ni-1 do check𡤏ix(4*(italic�se+i))('Italic correction');
@.Italic correction n is too big@>
if nk>0 then for i:=0 to nk-1 do check𡤏ix(kern(i))('Kern');
@.Kern n is too big@>
end;
procedure do←simple←things;
@z
045917: Open tty for output.
@x
@p begin initialize;@/
@y
@p begin tty←rewrite(output); initialize;@/
@z
082755: Close files when done.
@x
final𡤎nd:end.
@y
final𡤎nd:
file𡤌lose(pl𡤏ile);
byte𡤏ile𡤌lose(tfm𡤏ile);
end.
@z
082780: Define the externals.
@x
@* System-dependent changes.
@y
@* Externals for things in Cedar.
Here they are:

@<External procedure declarations for things implemented directly in Cedar@>=
procedure tty←rewrite(var f: text); external; {set up for output to terminal}
procedure byte𡤏ile←reset(var f: byte𡤏ile; ext: alfa); external;
{set up for input from byte file}
procedure file←rewrite(var f: text; ext: alfa); external; {set up for output to file}
procedure file𡤌lose(var f: text); external; {close a text file}
procedure byte𡤏ile𡤌lose(var f: byte𡤏ile); external; {close a byte file}

@ @<Types in the outer block@>=
byte𡤏ile = packed file of 0..255;

@ @<Glob...@>=
output: text;

@* System-dependent changes.
@z