Fonts

 BBS: Inland Empire Archive
Date: 06-11-92 (12:24)             Number: 292
From: MATT PRITCHARD @ 930/21      Refer#: NONE
  To: JON SPRINGER                  Recvd: NO  
Subj: Fonts                          Conf: (2) Quik_Bas
JS>  I recently wrote a hard font editor, so I could use differant fonts
JS>of my own design in QB programs.  For instance, I'm doing a
JS>japanese full screen editor for a friend of mine.  In any case,
JS>I would like some info, if anybody know how, on saving the
JS>fonts using the unique bit patterns of each byte.  ie, say I
JS>have a 8x8 font.  I want to use one character to represent the
JS>first line, another to represent the next, and so on, so the
JS>storage for each letter will take 8 bytes disk space rather than 64.
JS>  The inneffeincy is a real problem with 16x16 fonts for hi-rez
JS>graphics, and I don't know how to encode them.

Each "Bit" in a font is stored as a power of 2.  In a byte,
you have 8 "bits".  You add up (the power fo 2 values) for
all of the set bits to get the Byte value for a 8 bit
pattern.  Usually it goes from Left (hi) to right (low)
example...

 Bit #:    7    6    5    4    3    2    1    0
 Value:   128   64   32   16   8    4    2    1
         .    .    .    .    .    .    .    .    . Char
	   . XX . XX . XX . XX . XX .    .    .    . = 128+64+32+16+8
 "B"     .    . XX .    .    . XX . XX .    .    . = 64+8+4
         .    . XX .    .    . XX . XX .    .    . = 64+8+4
         .    . XX .    .    . XX . XX .    .    . = 64+8+4
         .    . XX . XX . XX . XX .    .    .    . = 64+32+16+8

         etc...

(I hope the mail processor has not reformatted the above text)

So the values for the above pattern are: 248, 76, 76, 76, 120

Store a 16x16 image as 2 bytes side by side, repeated 16 times.

JS>  Oh, one other thing on that subject...There are various .COM programs
JS>floating around local BBS's, quite small, which obviously poke
JS>fonts into (video?) memory, usually for text mode.  Does
JS>anybody know the locations of the system fonts for poking purposes?

They are in the Video Ram on an EGA/VGA adaptor, memory
pages 2 & 3 I think.  You should get a good video card
reference book for info on this.  There are BIOS functions
for re-defining characters.

Hope this helps.

-Matt P

===
 * SLMR 2.1a * My reality check just bounced.

--- InterPCB 1.50
 # Origin: CENTRAL BBS -Texas' BEST BBS! 214-393-7090 HST  3+GIGs (8:930/21)
 * Origin: Gateway System to/from RBBS-NET (RBBS-PC 1:10/8)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET