FreddyV wrote on 2022-01-31, 13:35:
It is not possible to change the font in CGA/EGA
It's possible to do in CGA with the following pascal source I wrote years ago (available in SWAG) :
UNIT graftabl;
{
released into the public domain
author : Emmanuel ROUSSIN
FIDO : 2:320/200.21
Email : obsolete email address removed
for using redefined characters (128 to 255) in CGA mode 4,5 and 6
without using GRAFTABL.EXE
}
INTERFACE
TYPE Tcaractere8 = array [1..8] of byte;
Tgraftabl = array [128..255] of Tcaractere8;
{
if you want to use only one font, define it in this unit, for example :
CONST the_only_font : Tgraftabl = (
(x,x,x,x,x,x,x,x),
.
.
(x,x,x,x,x,x,x,x),
(x,x,x,x,x,x,x,x)
);
Or you can in your main program :
VAR my_font : Tgraftabl;
and define it after
}
CONST font_CGA : Tgraftabl = (
(234,214,12,0,252,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,234),
(36,13,0,252,46,39,232,209),
(215,203,186,175,62,233,67,217),
(0,46,173,142,192,139,214,190),
(110,58,177,4,46,173,171,226),
(251,51,192,177,12,243,171,129),
(255,0,16,114,237,139,242,182),
(3,195,46,173,139,200,184,32),
(7,243,171,178,192,176,32,238),
(46,172,255,227,186,192,3,50),
(192,238,238,195,0,77,63,77),
(63,191,23,77,63,77,63,52),
(15,47,19,77,63,36,13,95),
(17,71,63,71,63,71,63,71),
(63,87,47,71,63,101,48,216),
(11,206,11,89,44,172,15,226),
(11,0,17,179,14,45,11,229),
(10,214,12,77,63,77,63,164),
(48,199,47,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0),
(0,80,176,32,230,32,88,207),
(0,0,0,0,0,0,234,52),
(15,0,252,253,38,247,38,247),
(38,253,38,253,38,247,38,247),
(38,253,38,2,39,183,62,253),
(38,253,38,216,62,5,196,0),
(1,1,4,0,7,35,194,0),
(218,1,196,0,3,25,212,0),
(112,79,92,47,95,7,4,17),
(0,7,6,0,0,0,0,0),
(225,36,199,40,8,224,240,163),
(255,0,204,1,202,9,206,0),
(0,0,0,0,0,0,12,0),
(255,218,20,192,0,0,1,2),
(3,4,5,6,7,16,17,18),
(19,20,21,22,23,8,0,15),
(0,0,184,3,196,2,3,0),
(3,2,206,5,16,14,0,32),
(7,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), 128€
(0,0,0,0,0,0,0,0),
(8,16,56,68,124,64,56,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,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), 144
(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),
(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), 160
(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),
(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), {176}
(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),
(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), {h32 : 192}
(240,240,240,0,0,0,0,0),
(15,15,15,0,0,0,0,0),
(255,255,255,0,0,0,0,0),
(0,0,0,240,240,0,0,0),
(240,240,240,240,240,0,0,0),
(15,15,15,240,240,0,0,0),
(255,255,255,240,240,0,0,0),
(0,0,0,15,15,0,0,0),
(240,240,240,15,15,0,0,0),
(15,15,15,15,15,0,0,0),
(255,255,255,15,15,0,0,0),
(0,0,0,255,255,0,0,0),
(240,240,240,255,255,0,0,0),
(15,15,15,255,255,0,0,0),
(255,255,255,255,255,0,0,0),
(0,0,0,0,0,240,240,240), {48} {208}
(240,240,240,0,0,240,240,240),
(15,15,15,0,0,240,240,240),
(255,255,255,0,0,240,240,240),
(0,0,0,240,240,240,240,240),
(240,240,240,240,240,240,240,240),
(15,15,15,240,240,240,240,240),
(255,255,255,240,240,240,240,240),
(0,0,0,15,15,240,240,240),
(240,240,240,15,15,240,240,240),
(15,15,15,15,15,240,240,240),
(255,255,255,15,15,240,240,240),
(0,0,0,255,255,240,240,240),
(240,240,240,255,255,240,240,240),
(15,15,15,255,255,240,240,240),
(255,255,255,255,255,240,240,240), {h3F}
(0,0,0,0,0,15,15,15), {h40} {224}
(240,240,240,0,0,15,15,15),
(15,15,15,0,0,15,15,15),
(255,255,255,0,0,15,15,15),
(0,0,0,240,240,15,15,15),
(240,240,240,240,240,15,15,15),
(15,15,15,240,240,15,15,15),
(255,255,255,240,240,15,15,15),
(0,0,0,15,15,15,15,15),
(240,240,240,15,15,15,15,15),
(15,15,15,15,15,15,15,15),
(255,255,255,15,15,15,15,15),
(0,0,0,255,255,15,15,15),
(240,240,240,255,255,15,15,15),
(15,15,15,255,255,15,15,15),
(255,255,255,255,255,15,15,15),
(0,0,0,0,0,255,255,255), {h50} {240}
(240,240,240,0,0,255,255,255),
(15,15,15,0,0,255,255,255),
(255,255,255,0,0,255,255,255),
(0,0,0,240,240,255,255,255),
(240,240,240,240,240,255,255,255),
(15,15,15,240,240,255,255,255),
(255,255,255,240,240,255,255,255),
(0,0,0,15,15,255,255,255),
(240,240,240,15,15,255,255,255),
(15,15,15,15,15,255,255,255),
(255,255,255,15,15,255,255,255),
(0,0,0,255,255,255,255,255),
(240,240,240,255,255,255,255,255),
(15,15,15,255,255,255,255,255),
(255,255,255,255,255,255,255,255) {h5F} {255}
);
VAR seg_graftabl,
ofs_graftabl : word;
{internal procedures}
procedure get_graftabl(VAR segment, offset : word);
procedure put_graftabl(segment, offset : word);
{procedures to use in your programs}
procedure init_graftabl;
procedure use_graftabl(VAR aray : Tgraftabl);
procedure end_graftabl;
IMPLEMENTATION
procedure get_graftabl(VAR segment, offset : word);
BEGIN
segment:=memw[0:$1F*4+2];
offset:=memw[0:$1f*4];
END;
procedure put_graftabl(segment, offset : word);
BEGIN
memw[0:$1f*4+2]:=segment;
memw[0:$1f*4]:=offset
END;
procedure init_graftabl;
{
interrupt 1F is a pointer to bitmaps for high 128 chars
(8 bytes per character) defined by GRAFTABL.EXE
we save this initial pointer
}
BEGIN
get_graftabl(seg_graftabl,ofs_graftabl);
END;
procedure use_graftabl(VAR aray : Tgraftabl);
{
we define a new pointer : the address of an array
}
BEGIN
put_graftabl(seg(aray),ofs(aray));
END;
procedure end_graftabl;
{
we restore the original pointer
}
BEGIN
put_graftabl(seg_graftabl,ofs_graftabl);
END;
END.