Re: Regarding VGA Fonts ?

H. Peter Anvin (hpa@transmeta.com)
19 Sep 1997 02:29:07 GMT


Followup to: <Pine.LNX.3.96.970918151543.2370B-100000@sigil.computersupportcentre.com>
By author: Teunis Peters <teunis@usa.net>
In newsgroup: linux.dev.kernel
>
> IIRC, X apparently wipes out the font settings....
>
> The format of a .PSF file is as follows: (from kbd_utils)
>
> Byte Size of field Contents
> 0 Word File ID, always 0436h
> 2 Byte File mode
>
> === FILE MODE 0: 256 character byte-aligned monofont (as used by EGA/VGA)
>
> 3 Byte Height of characters in scan lines
> 4... 256x[byte 3] bytes Font data; each character contains one byte
> per scan line, characters continuous
>
> === FILE MODE 1: 512 character byte-aligned monofont
>
> 3 Byte Height of characters in scan lines
> 4... 512x[byte 3] bytes Font data; each character contains one byte
> per scan line, characters continuous
>

There are two more modes not reflected in that file: modes 2 and 3,
which are the same as modes 0 and 1 except that a Unicode table is
attached at the end. The Unicode table has the following format:

For each font position (256 or 512, respectively):

- A list of Unicodes[1] corresponding to that one font position.
- A 0xffff separator.

We need a better bitmap font format which can contain embedded
Unicodes, still. I'm probably going to hack one up sooner or later...

-hpa

[1] encoded as UCS-2 **in the same endianism as the 0x0436 magic** --
so far universally(?) littleendian, and I don't think all the tools
check properly since it was meant to be a hardware-specific format
anyway...

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see http://www.bahai.org/