home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / list / hb15-pt1.ark / FONT.PAS < prev    next >
Pascal/Delphi Source File  |  1986-10-21  |  3KB  |  68 lines

  1. { Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
  2.  
  3. {$I-}
  4.  
  5. program GenerateFont ;
  6.  
  7. {$I Font.con                    CONstant declarations       }
  8. {$I Font.typ                    TYPe declarations           }
  9. {$I Font.var                    VARiable declarations       }
  10.  
  11.      i              : integer ;
  12.  
  13. {$I iFont.pas                   Initialize font             }
  14. {$I uFont.pas                   Utility routines            }
  15. {$I pChar.pas                   Plot character with pattern }
  16. {$I fChar.pas                   Fill character              }
  17. {$I rChar.pas                   Rasterize character         }
  18. {$I xFont.pas                   eXtend font                 }
  19. {$I fFont.pas                   Finalize                    }
  20.  
  21. begin
  22.                                 { fanfare }
  23.    writeln ('Font Generator 1.4 (C) 1986 Adam Fritz') ;
  24.                                 { initialize }
  25.    InitFont ;
  26.                                 { generate font }
  27.    i := nbIndex div 2 ;
  28.    while not EOF(hID) do begin
  29.                                 { get character designation }
  30.       readln (hID, hChar, hNumber) ;
  31.                                 { ... underbar means blank }
  32.       if hChar = '_' then
  33.          hChar := ' ' ;
  34.       iChar := Ord(hChar) ;
  35.       writeln (hChar,' ',hNumber) ;
  36.                                 { if character not already defined }
  37.       if fIndex[iChar].iDef = 0 then begin
  38.                                 { incrementally search Hershey index }
  39.          if hNumber > bIndex[i].iNum then
  40.             while (hNumber > bIndex[i].iNum) and (i < nbIndex) do
  41.                i := i + 1
  42.          else
  43.             while (hNumber < bIndex[i].iNum) and (i > 0) do
  44.                i := i - 1 ;
  45.                                 { extend font }
  46.          if hNumber = bIndex[i].iNum then begin
  47.                                 { indexed sequential access to Hershey data }
  48.             bRecord := bIndex[i].iRec ;
  49.             Seek (bdID, bRecord) ;
  50.             BlockRead (bdID, bData, 1) ;
  51.             bOffset := bIndex[i].iOff ;
  52.                                 { update font index }
  53.             fIndex[iChar].iDef := 1 ;
  54.             fIndex[iChar].iOff := fOffset ;
  55.                                 { extend font }
  56.             ExtendFont
  57.          end
  58.          else
  59.             writeln ('Error: Unable to Find Designation Number ',hNumber)
  60.       end
  61.    end ;
  62.                                 { finalize }
  63.    FinFont
  64.  
  65. end.
  66.  
  67. { Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
  68.