From: korni@moon.wupper.de (Lars Kornwinkel)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Ms-Dos font reprogramming.

Hello !

omard@blue.seas.upenn.edu wrote:
>I would like to change the fonts that the computer uses for dos.

At first you have to get access to the fontdata which is stored in the
videoram.

To do so you have to change regs in the sequencer controller and the
graphics controller.

Sequencer (port : 3C4H)
  0100h   (PortW[3C4h]:=$100)
  0402h    etc.
  0704h
  0300h  

Grafics Ctrl (port : 3CEh)
  0204h
  0005h
  0406h

You can now acces the font tables at segment A000h.
There are 8 different font tables available (4 on EGA), with these
offsets:
1.  0000h
2.  4000h
3.  8000h
4.  C000h
5.  2000h
6.  6000h
7.  A000h
8.  E000h

Each table has a size of 32*256 byte, that's 32 byte/char and 256
chars. 
Each byte of these table equals one line (a bit = one pixel)
The first byte of each table is the top line of char #0 of this table,
the 12th byte  = line 12 of char #0
the 33th byte  = top line of char #1 etc.

Every char consists of 32 lines no matter how many lines are displayd.

You can also display 2 of the 8 fonts at the same time.
To choose ehich font should by your first and which your second one
you have to do this
  
Sequencer (3C3h) Register 3
  7  6  5  4  3  2  1  0  (bits of register)
           B3       B2 B1 (bits use for font 1)
        B3    B2 B1       (bits use for font 1)    

B1 first bit of desired value (0-7)
B2 etc.

To wrtite with the first font you have to choose foreground colors
slmaller then 8 (that's because the highest bit of color is used to
select fonts).

Color>=8 second font

Before you can write text to the videoram you have to reset the
sequencer and graphx-ctrl to their old values (you cannot access the
font tables and the videoram at the same time)

Sequencer (port : 3C4H)
  0100h  
  0302h  
  0304h
  0300h  

Grafics Ctrl (port : 3CEh)
  0004h
  1005h
  0E06h

Hope that helps.

  Lars


   __________________________       
  (_)                        )       
   /   Lars Kornwinkel      /   
  (                        (  
   \  korni@moon.wupper.de  \
    )________________________)


