Hi, I wanted to hear what your suggestions are regarding the problem of text output if no font is available. I thought of an array which looks like this (e.g. A):
Code:
{0,0,0,0,0,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,0,0,1,0,0,
0,1,0,0,0,0,1,0,
0,1,1,1,1,1,1,0,
0,1,0,0,0,0,1,0,
0,1,0,0,0,0,1,0,
0,0,0,0,0,0,0,0}
etc. But I think that drawing always 64 pixels per character is a bit too time consuming.
Any ideas?
Ok, I think it will work if I update the screen after the complete text string is written. Since I can save a lot of time I might use the fontdata.inc of the Unit graph from Freepascal.
It starts like this:
Code:
{******************************************}
{ Bitmapped font data - unrolled for }
{ faster access. Each character is an }
{ 8x8 byte array representing the full }
{ bitmap. 0 = nothing, 1 = color }
{******************************************}
TYPE
TBitMapChar = array[0..7,0..7] of byte;
CONST
DefaultFontData: Array[#0..#255] of TBitmapChar = (
(
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0)),
...
So I can access the individual pixels via
Code:
DefaultFontData[char][x][y];
Bookmarks