home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / h / htmix20.zip / FE.ZIP / LOADFNT.PAS < prev    next >
Pascal/Delphi Source File  |  1992-07-11  |  2KB  |  50 lines

  1. program LoadFont;
  2. {┌──────────────────────────────── INFO ────────────────────────────────────┐}
  3. {│ File    : LOADFNT.PAS                                                    │}
  4. {│ Author  : Harald Thunem                                                  │}
  5. {│ Purpose : Load a VGA text font from file.                                │}
  6. {│ Updated : July 10 1992                                                   │}
  7. {└──────────────────────────────────────────────────────────────────────────┘}
  8.  
  9. {────────────────────────── Compiler directives ─────────────────────────────}
  10. {$A+   Word align data                                                       }
  11. {$B-   Short-circuit Boolean expression evaluation                           }
  12. {$E-   Disable linking with 8087-emulating run-time library                  }
  13. {$G+   Enable 80286 code generation                                          }
  14. {$R-   Disable generation of range-checking code                             }
  15. {$S-   Disable generation of stack-overflow checking code                    }
  16. {$V-   String variable checking                                              }
  17. {$X-   Disable Turbo Pascal's extended syntax                                }
  18. {$N+   80x87 code generation                                                 }
  19. {$D-   Disable generation of debug information                               }
  20. {────────────────────────────────────────────────────────────────────────────}
  21.  
  22. uses  Dos,
  23.       Strings,
  24.       FEUnit;
  25.  
  26. var   Path : PathStr;
  27.       Dir  : DirStr;
  28.       Name : NameStr;
  29.       Ext  : ExtStr;
  30.  
  31. begin
  32.   WriteLn('Load font v2.0');
  33.   WriteLn;
  34.   if ParamCount<>1 then
  35.   begin
  36.     WriteLn('Wrong number of parameters.');
  37.     WriteLn('Usage : LOADFNT filename.ext');
  38.     Halt(1);
  39.   end;
  40.   Path := UpcaseStr(ParamStr(1));
  41.   FSplit(Path,Dir,Name,Ext);
  42.   if Ext='' then
  43.     Path := Dir+Name+'.FNT';
  44.   if ReadFontFile(Path) then
  45.   begin
  46.     LoadUserFont;
  47.     WriteLn('Font ',Name,' loaded.');
  48.   end
  49.   else WriteLn('Error loading fontfile ',Path);
  50. end.