home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpm
/
list
/
hb15-pt1.ark
/
PCHAR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-10-21
|
2KB
|
81 lines
{ Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
procedure PlotChar ( var lm, rm : integer ) ;
var
i : integer ;
nStrokes : byte ;
nSegs : byte ;
x0, y0 : integer ;
x1, y1 : integer ;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function GetData : integer ;
{ read Hershey data file byte by byte }
var
b : byte ;
begin
b := bData[bOffset] ;
if b < 128 then
GetData := b
else
GetData := b - 256 ;
bOffset := bOffset + 1 ;
if bOffset = 128 then begin
BlockRead (bdID, bData, 1) ;
if IOResult <> 0 then begin
writeln ('Error: Unable to Read Hershey Data File.') ;
BIOS(0)
end
else
bOffset := 0
end
end ;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
begin
{ clear pad }
for i := 0 to nPad do
Pad[i] := 0 ;
{ get left and right margins }
lm := GetData ;
rm := GetData ;
{ get stroke count }
nStrokes := GetData ;
while nStrokes > 0 do begin
nStrokes := nStrokes - 1 ;
{ get segment count }
nSegs := GetData ;
if nSegs > 0 then begin
if Rotate then begin
y0 := yScale * GetData ;
x0 := xScale * GetData
end
else begin
x0 := xScale * GetData ;
y0 := - yScale * GetData
end ;
{ initialize stroke sequence }
Move (x0,y0) ;
while nSegs > 1 do begin
nSegs := nSegs - 1 ;
if Rotate then begin
y1 := yScale * GetData ;
x1 := xScale * GetData
end
else begin
x1 := xScale * GetData ;
y1 := - yScale * GetData
end ;
{ draw segment }
Draw (x1,y1) ;
end
end
end
end ;
{ Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }