home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / QBSCR20.ZIP / QFONT.BAS < prev    next >
Encoding:
BASIC Source File  |  1992-07-08  |  2.1 KB  |  82 lines

  1. ' ──────────────────────────────────────────────────────────────────────────
  2. '
  3. '                             Q F O N T . B A S
  4. '
  5. '      A utility for changing the screen font at DOS using a VGA monitor
  6. '
  7. '     This program, source code and executable, are (c) Copyright 1992 by
  8. '                                Tony Martin.
  9. '
  10. '  To compile this file, you must either use the command line
  11. '
  12. '                            QB QFONT / L QBSCR20
  13. '
  14. '  Or use the source builder program to create a source file that includes
  15. '  the routines FirstFile, VgaPresent, EgaPresent, LoadEgaTextFont,
  16. '  and LoadVgaTextFont, and load it in into QuickBASIC in addition to
  17. '  this file.  If you go the second route, you must load this program with
  18. '  the QB library, provided with QuickBASIC.  Use the following command line
  19. '  to do this:
  20. '
  21. '                               QB QFONT /L QB
  22. '
  23. ' ──────────────────────────────────────────────────────────────────────────
  24.  
  25. '$INCLUDE: 'qb.bi'
  26. '$INCLUDE: 'qbscr.inc'
  27.  
  28. CONST EGA = 0
  29. CONST VGA = 1
  30.  
  31. ' Increase stack space.
  32. CLEAR , , 8192
  33.  
  34. ' Display help if requested.
  35. IF COMMAND$ = "/?" THEN
  36.     PRINT
  37.     PRINT "Usage: QFONT [fontfile] [/?]"
  38.     PRINT
  39.     PRINT "       where fontfile is the name of the VGA font file to load."
  40.     PRINT "       Omitting a fontfile on the command line resets the font to normal."
  41.     END
  42. END IF
  43.  
  44. ' See if we are using a VGA monitor.
  45. IF VgaPresent% = FALSE THEN
  46.     IF EgaPresent% = FALSE THEN
  47.         PRINT
  48.         PRINT "You need an EGA or VGA adapter and display to use QFONT"
  49.         END
  50.     ELSE
  51.         adapter% = EGA
  52.     END IF
  53. ELSE
  54.     adapter% = VGA
  55. END IF
  56.  
  57. ' See if requested file exists.  If not, dispay a message end exit.
  58. IF COMMAND$ <> "" THEN
  59.     IF FirstFile%(COMMAND$, NormalAttr, dta$) = 0 THEN
  60.         PRINT
  61.         PRINT "The font requested, "; COMMAND$; ", does NOT exist."
  62.         END
  63.     END IF
  64. END IF
  65.  
  66. ' Display header and set font.
  67. PRINT : PRINT "QFONT ∙ (c) 1992 by Tony Martin."
  68. IF COMMAND$ <> "" THEN
  69.     PRINT "Loading font "; UCASE$(COMMAND$); "..."
  70. ELSE
  71.     PRINT "Reseting to internal font..."
  72. END IF
  73.  
  74. IF adapter% = VGA THEN
  75.     LoadVgaTextFont COMMAND$
  76. ELSE
  77.     LoadEgaTextFont COMMAND$
  78. END IF
  79.  
  80. END
  81.  
  82.