home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FNTPAK32.ZIP / PASCAL.EXE / DEMO_LIN.PAS < prev    next >
Pascal/Delphi Source File  |  1995-08-16  |  4KB  |  111 lines

  1. {*******************************************************************
  2.  
  3.     Demo_Lin.Pas                Copyright 1994, Rob W. Smetana
  4.  
  5.     Font Pak demo program which shows how to:
  6.  
  7.       1.  Use SetMaxLines (...) to switch to 14 - 100 lines on
  8.           the screen -- in TEXT mode!
  9.  
  10.       2.  Load a Font Pak font (from 4 to 24 points) to finish
  11.           the process.
  12.  
  13.     NOTICE:  We MUST add 100 to Block number to make this work.
  14.  
  15.     Requires:
  16.  
  17.       a.  A callable Font Pak font (e.g., Tiny04.F06)
  18.       b.  Procedures in Video.Obj (SetmaxLines, WriteChar, etc.)
  19.  
  20. ********************************************************************}
  21.  
  22. Uses Crt,                        { for TextMode (...), etc.         }
  23.      Font_Pak;                   { for declarations & to link OBJs  }
  24.  
  25. {$F+}   (*BE SURE to make FAR calls to our procedures!!!! *)
  26.  
  27. Procedure TINY04(Block: Integer); External;
  28.           {$L tiny04.Obj}
  29.  
  30. {$F-}
  31.  
  32. { ********************************************************************** }
  33.  
  34. Var
  35.  
  36.    MonType, CharHite, NumLines, Col : Integer;
  37.    s: string;
  38.  
  39. {****************************************************}
  40. procedure ShowLines (NumLines:Integer);
  41. {****************************************************}
  42.    var
  43.       s,l:string;
  44.       Row, Char, AsciiCode, LenString, Colr:Integer;
  45.  
  46.    Begin
  47.  
  48.    s := ' This is line #:      Press <enter>...';  { fill the blanks below }
  49.    LenString := ord(s[0]);
  50.    Colr := 79;                                 { 79 = white on red }
  51.  
  52.    For Row := 3 to NumLines Do
  53.        Begin
  54.          Str(Row,l);
  55.          For Char := 1 to ord(l[0]) do         { plug in current line # }
  56.              s[Char + 17] := l[char];
  57.  
  58.          For Char := 1 to LenString Do
  59.              Begin
  60.                 AsciiCode := ord(s[Char]);     { WriteChar needs an INT}
  61.                 WriteChar (Row, 22+Char, AsciiCode, Colr);
  62.              End;
  63.        End;
  64.    ReadLn;
  65.  
  66.    End;
  67.  
  68. {****************************************************}
  69. Begin
  70. {****************************************************}
  71.  
  72.    TextAttr := 27; ClrScr;
  73.    fpinitialize; ClrScr;            { for shareware versions only }
  74.  
  75.    MonType := GetMonitor;
  76.    if (MonType < 4) then
  77.       Begin
  78.          WriteLn ('Sorry. An EGA or VGA monitor is required.');
  79.          Halt;
  80.       End;
  81.  
  82.    { NOTE:
  83.       On VGA monitors, here's how you can get 28 lines using the 8x14.
  84.       If you have an EGA, the default 8x14 yields the default 25 lines.
  85.    }
  86.    TextMode(co80 + font8x8);        { ALWAYS change screen modes! }
  87.    CharHite := 14;                  { use the default 8x14 }
  88.    NumLines := SetMaxLines (CharHite);
  89.    rsLoadDefault(CharHite, 0+100);  { load it into block 0 -- the default }
  90.                                     { BE SURE to add 100 to block # }
  91.  
  92.    TextAttr := 112; GotoXY(12,1);
  93.    Write (' Using the default 8x14, we can get ', NumLines, ' lines on the screen! ');
  94.    ShowLines (NumLines);
  95.  
  96.    TextMode(co80 + font8x8);       { get max # of lines }
  97.  
  98.    CharHite := 6;                  { tiny04 is a 4-point font in 6x8 grid }
  99.    NumLines := SetMaxLines (CharHite);
  100.    Tiny04 (0+100);                 { re-map block 0 -- the default font }
  101.                                    { BE SURE to add 100 to block #      }
  102.  
  103.    TextAttr := 112; GotoXY(14,1);
  104.    Write (' Using font Tiny04, we can get ', NumLines, ' lines on the screen! ');
  105.  
  106.    ShowLines (NumLines);
  107.  
  108.    TextMode(co80);                             { restore some normalcy }
  109.  
  110. End.
  111.