@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 @x @d print_ln(#)==write_ln(#) @y @d print_ln(#)==writeln(#) @d write_ln(#) == writeln(#) @z @x var @@/ procedure initialize; {this procedure gets things started properly} @y var @@/ @@/ procedure initialize; {this procedure gets things started properly} @z @x @!tfm_file:packed file of 0..255; @y @!tfm_file: byte_file; @z @x reset(tfm_file); @y byte_file_reset(tfm_file, 'tfm '); @z @x rewrite(pl_file); @y file_rewrite(pl_file, 'pl '); @z @x @= if nonzero_fix(4*width_base) then bad('width[0] should be zero.'); @.should be zero@> if nonzero_fix(4*height_base) then bad('height[0] should be zero.'); if nonzero_fix(4*depth_base) then bad('depth[0] should be zero.'); if nonzero_fix(4*italic_base) then bad('italic[0] should be zero.'); for i:=0 to nw-1 do check_fix(4*(width_base+i))('Width'); @.Width n is too big@> for i:=0 to nh-1 do check_fix(4*(height_base+i))('Height'); @.Height n is too big@> for i:=0 to nd-1 do check_fix(4*(depth_base+i))('Depth'); @.Depth n is too big@> for i:=0 to ni-1 do check_fix(4*(italic_base+i))('Italic correction'); @.Italic correction n is too big@> if nk>0 then for i:=0 to nk-1 do check_fix(kern(i))('Kern'); @.Kern n is too big@> @y @= check_the_fix_word_entries; @z @x @p procedure do_simple_things; @y @p procedure check_the_fix_word_entries; var i:0..@'77777; {an index to words of a subfile} begin if nonzero_fix(4*width_base) then bad('width[0] should be zero.'); @.should be zero@> if nonzero_fix(4*height_base) then bad('height[0] should be zero.'); if nonzero_fix(4*depth_base) then bad('depth[0] should be zero.'); if nonzero_fix(4*italic_base) then bad('italic[0] should be zero.'); for i:=0 to nw-1 do check_fix(4*(width_base+i))('Width'); @.Width n is too big@> for i:=0 to nh-1 do check_fix(4*(height_base+i))('Height'); @.Height n is too big@> for i:=0 to nd-1 do check_fix(4*(depth_base+i))('Depth'); @.Depth n is too big@> for i:=0 to ni-1 do check_fix(4*(italic_base+i))('Italic correction'); @.Italic correction n is too big@> if nk>0 then for i:=0 to nk-1 do check_fix(kern(i))('Kern'); @.Kern n is too big@> end; procedure do_simple_things; @z @x @p begin initialize;@/ @y @p begin tty_rewrite(output); initialize;@/ @z @x final_end:end. @y final_end: file_close(pl_file); byte_file_close(tfm_file); end. @z @x @* System-dependent changes. @y @* Externals for things in Cedar. Here they are: @= procedure tty_rewrite(var f: text); external; {set up for output to terminal} procedure byte_file_reset(var f: byte_file; 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_close(var f: text); external; {close a text file} procedure byte_file_close(var f: byte_file); external; {close a byte file} @ @= byte_file = packed file of 0..255; @ @= output: text; @* System-dependent changes. @z š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. 003093: Change write_ln to writeln. 003287: Allow for external procedure and function declarations for things implemented directly in Cedar, rather than in Pascal. 004707: Packed file of 0..255 needs an id; call it a byte_file. 005052: Hook up open call to Cedar. 017224: Here's a rewrite. 036394: Break up a big proc by deleting a big chunk . . . (see also below) 045513: And moving it somewhere else as a separate proc. 045917: Open tty for output. 082755: Close files when done. 082780: Define the externals. ΚT˜J™™4Icode™(—J˜unit™˜J˜J—˜JšœO˜O—J˜—™#˜J˜—˜J˜J˜—J˜—™˜J˜$J˜C—˜J˜$JšœN˜NJ˜C—J˜—™@˜J˜!—˜J˜—J˜—™#˜J˜—˜J˜(—J˜—™˜J˜—˜J˜$—J˜—™J˜J˜!J˜Υ—˜J˜!J˜—J˜—™8˜J˜—˜J˜(J˜3J˜ΫJ˜J˜J˜—J˜—™˜J˜—˜J˜+—J˜—™˜J˜—˜J˜ J˜J˜J˜—J˜—™˜J˜—˜Jšœ—˜——J˜—J˜—…—