home *** CD-ROM | disk | FTP | other *** search
/ Compu-Fix / Compu-Fix.iso / misc / fonts / pas_demo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-03-01  |  3.0 KB  |  82 lines

  1. (* FONT MANIA pascal font *)
  2.  
  3. uses
  4.     DOS, CRT;
  5.  
  6. (*--------------------------------------------------------------------------
  7.  
  8.    Font is saved in the file named DEMO.PAS.  To use the font, you must call
  9.    interrupt 10h, function 11h, sub-function 10h to load the font.
  10.    
  11.    The following are the parameters needed to call the function:
  12.   
  13.                   AX  =  $1110      (ah = $11, al = $10)
  14.           BH  =  bytes per character 
  15.           BL  =  block to load to.  (use 0)
  16.           CX  =  number of character defined by table
  17.           DX  =  starting character value
  18.           ES  =  segment of the table (use Seg())
  19.           BP  =  offset of the table (use Ofs())
  20.  
  21.    Notice: The character should always be loaded immediately after setting
  22.            the Video mode.  If it is not called immediately after the video 
  23.            mode is set, some side effects may occur.  We have experienced 
  24.            some palette errors when this function is called without setting
  25.            the video mode.  The appearance of this effect is intermittent and
  26.            unpredictable, but it may be avoided by following the recommend-
  27.            ation in this paragraph.
  28.    
  29.    FONT MANIA will supply you with the height of the font.  It is defined
  30.    by your label name with "_POINTS" added at the end of the string.  For
  31.    example, if your label reference is called DEMO, then DEMO_POINTS will 
  32.    represent the bytes-per-character of the font (the height of the font).
  33.    
  34.    Set the CX to 256 if you want to load the whole font. If you want to 
  35.    load only part of the font,  set CX to the number of the character 
  36.    you want to load, and set DX to the first character you want to load.
  37.    
  38.    For example, suppose you want to load characters 65 to 88, (A to Z) and
  39.    the label reference is DEMO.  Here are the parameters needed:
  40.    
  41.          AX  =  $1110;
  42.          BH  =  DEMO_POINTS;
  43.          BL  =  0;
  44.          CX  =  24;               ( 24 characters to load )
  45.          DX  =  65;               ( first character to load )
  46.          ES  =  Seg(DEMO);
  47.          BP  =  Ofs(DEMO);
  48.          
  49.    See below for examples of how to set the registers. 
  50.          
  51.           
  52. ---------------------------------------------------------------------------*)
  53.  
  54. {$I DEMO.PAS}            
  55. Var
  56.    r : registers;
  57.    temp : char;
  58.  
  59. BEGIN
  60.   WriteLn('This is a font test');
  61.   WriteLn('Press any key to begin upload the font');
  62.   temp := readkey;
  63.  
  64.   r.ax := $0500;            (* make sure that it's page 0 *)
  65.   intr($10, r);
  66.   
  67.   r.ax := 3;                (* must set the vdo mode first *)
  68.   intr($10, r);
  69.  
  70.   r.ax := $1110;
  71.   r.bh := test_points;                   (* bytes per character *)
  72.   r.bl := 0;                             (* load to block 0 *)
  73.   r.cx := 256;                           (* 256 characters *)
  74.   r.dx := 0;                             (* start with character 0 *)
  75.   r.es := Seg(test);                     (* segment of table *)
  76.   r.bp := Ofs(test);                     (* offset of the table *)
  77.   intr($10, r);
  78.  
  79.   WriteLn('Font loadded');
  80.   temp := readkey;
  81.  
  82. END.