home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / SVGALIB / _SVGALIB.TAR / usr / doc / svgalib / README.utils < prev    next >
Encoding:
Text File  |  1995-01-18  |  3.6 KB  |  103 lines

  1.  
  2. 1.    Restoring corrupted textmode fonts.
  3.  
  4. If XFree86 corrupts your textmode font, try putting restorefont
  5. in your path and using the shell script runx to run X. runx saves
  6. the VGA font data in /tmp/fontdata, and restores it when you exit X.
  7.  
  8. Note that this doesn't help with syncing problems.
  9.  
  10. A more rigorous alternative is to run the 'savetextmode' script before
  11. running X, and 'textmode' after. This will restore the textmode registers
  12. and the VGA palette in addition to the VGA font.
  13.  
  14.  
  15. 2.    Changing the textmode font.
  16.  
  17. The VGA font format:
  18.  
  19. offset
  20. 0-31        character 0
  21. ...        ...
  22. 8164-8195    character 255
  23.  
  24. Each row of a character bitmap is stored as a byte (8 pixels).
  25. The space that is left from the 32-byte buffer for each character
  26. is ignored, e.g. a 16-line font uses only offsets 0-15 of each character.
  27.  
  28. Linux text resolutions:
  29.  
  30. 80x25        16 line font    400 scanlines
  31. 80x28        14 line font    400 scanlines
  32. 80x50        8 line font    400 scanlines
  33.  
  34. The font sizes and resolutions of extended textmodes depend on the
  35. video card type and BIOS:
  36.  
  37. 132x25        14 line font    350 scanlines (ugly)
  38. 132x25        16 line font    400 scanlines
  39. 132x43        8 line font    350 scanlines (use fix132x43 to fix/improve)
  40. 132x50        8 line font    400 scanlines
  41.  
  42. To load a font into video memory, use
  43.  
  44.     restorefont -r fontname
  45.  
  46. Using a font that has less lines per character than the textmode works, but
  47. the characters are smaller. Using a font that is bigger than the textmode
  48. font results in the bottom part of characters being cut off.
  49.  
  50. I've included sample fonts with 8, 14 and 16 line characters.
  51.  
  52. The convfont program can be used to convert fonts straightforwardly stored 
  53. character-after-character (i.e. each character only uses 8/14/whatever
  54. bytes), to the 32-byte per character format that restorefont requires.
  55.  
  56.  
  57. 3.    Setting the VGA palette
  58.  
  59. 'restorepalette' sets the standard VGA palette; this can be useful
  60. if it is somehow messed up. With a filename argument a custom
  61. palette can be loaded (added by Charles Blake,
  62. chuckb@alice.wonderland.caltech.edu).
  63.  
  64. The changes allow a user to set up a file that looks like this one:
  65.  
  66.  0  0  0  0    # black               THESE COLOR MAP DEFINITIONS ARE
  67.  1  0  0 42    # blue                THE SAME AS THE DEFAULT VGA ONES
  68.  2  0 42  0    # green
  69.  3  0 42 42    # cyan                ALTER TO SUITE PERSONAL TASTES
  70.  4 42  0  0    # red
  71.  5 42  0 42    # magenta
  72.  6 42 21  0    # brown
  73.  7 42 42 42    # white
  74.  8 21 21 21    # bright black
  75.  9 21 21 63    # bright blue
  76. 10 21 63 21    # bright green
  77. 11 21 63 63    # bright cyan
  78. 12 63 21 21    # bright red
  79. 13 63 21 63    # bright magenta
  80. 14 63 63 21    # bright brown
  81. 15 63 63 63    # bright white
  82.  
  83. Then run the command "restorepalette pathname". The inline comments are the
  84. only kind allowed, as I use a little fscanf() trick to get them. Blank lines
  85. are ok, but not pure comment lines. See the comments in my code, also.
  86.  
  87. This allows people to set up custom palettes for use in virtual console text
  88. modes. I use it all the time. When combined with a color-syntax editor like
  89. jed-0.97+ or color-ls, etc, being able to choose your own text-mode palette is
  90. quite a bonus. I set mine up via "restorepalette /etc/palette" in my /etc/rc.
  91. If the program is given the correct permissions, then individual users can
  92. have "restorepalette ~/.palette" or some such thing in their shell startup
  93. files. Of course, it shouldn't be done when starting remote shells or when
  94. under X, so some kind of test that TERM is a virtual console is needed for
  95. that case.
  96.  
  97.  
  98. References
  99.  
  100. The national/fontpak packages, which include kernel patches, allow different
  101. textmode fonts to be used in different virtual consoles. These have been
  102. superseded by the kbd package (in the kernel since pl15).
  103.