home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
CTSELECT
/
TERM151
/
0151TER2._XE
/
rar
/
PASCAL.EXE
/
SHOWFONT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-03-11
|
3KB
|
118 lines
Program ShowFont;
{
Example for loading and showing a font for Terminate.
By Bo Bendtsen and Bjarne Duelund 1994
Free to use or modify
Font format:
msb lsb
SmallFont: 'A' |1.byte||2.byte|
000011111100----
001100000011----
001100000011----
001100000011----
001111111111----
001100000011----
001100000011----
000000000000----
msb lsb
LargeFont: 'A' |1.byte||2.byte||3.byte|
00000000000000000000----
00000000000000000000----
00000000000000000000----
00001111110000000000----
00000000110000000000----
00000001111000000000----
00000011001100000000----
00000110000110000000----
00001100000011000000----
00011111111111100000----
00110000000000110000----
01100000000000011000----
11110000000000111100----
00000000000000000000----
00000000000000000000----
00000000000000000000----
}
Type
FontType = Record
{ 12 pixel x 8 lines, 2 bytes/line }
SmallFont :Array[0..255] of Array[0..15] of Byte;
{ 20 pixel x 16 lines, 3 bytes/line }
LargeFont :Array[0..255] of Array[0..47] of Byte;
End;
Var
Font : FontType;
FontFile : File of FontType;
f,x,y,z,p : Word;
Begin
If Paramcount<>1 Then
Begin
WriteLn('Syntax: SHOWFONT fontname');
Halt;
End;
Assign(FontFile,Paramstr(1));
{$I-} Reset(FontFile); {$I+}
If IOResult<>0 Then
Begin
WriteLn('Could not open '+Paramstr(1));
Halt;
End;
Read(FontFile,Font);
Close(FontFile);
Asm { 640x480x2 mono vga }
Mov ah,0
Mov al,$11
Int $10
End;
Writeln('Small font'#10#10#10#10#10#10#10#10#10#13'Large font'+
#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10);
{ Show small font }
f:=0;
For z:=0 to 7 Do
Begin
For x:=0 to 31 Do
For y:=0 to 15 Do
Begin
Move(Font.SmallFont[f+x][y],Mem[$A000:(y*40)+1600+(x*2)+(z*1200)],2);
Inc(y);
End;
Inc(f,32);
End;
{ Show large font }
f:=0;
For p:=0 To 15 Do
Begin
For x:=0 to 15 Do
Begin
z:=0;
For y:=0 to 47 Do
Begin
Move(Font.LargeFont[f+x][y],Mem[$A000:12800+(z*80)+(x*4)+(p*1360)],3);
Inc(z);
Inc(y,2);
End;
End;
Inc(f,16);
End;
Readln;
Asm { normal videomode }
Mov ah,0
Mov al,$3
Int $10
End;
End.