Re: MININIM Source Code Study
Posted: February 19th, 2017, 3:20 pm
Do you know if I can get the original fonts from the DOS version? I guess they must be inside the EXE file somewhere...
You can get it as PNG images from SDLPoP: https://github.com/NagyD/SDLPoP/tree/master/data/fontNick2017 wrote:Do you know if I can get the original fonts from the DOS version?
Yes, it is.Nick2017 wrote:I guess they must be inside the EXE file somewhere...
Code: Select all
typedef struct font_type {
byte first_char;
byte last_char;
short height_above_baseline;
short height_below_baseline;
short space_between_lines;
short space_between_chars;
chtab_type* chtab;
} font_type;
This is not MININIM related. Please move this discussion to an appropriate thread, probably in SDLPoP's forum.Nick2017 wrote:Ok, I've been looking at the function "font_type load_font_from_data(/*const*/ rawfont_type* data)"...
Code: Select all
typedef struct font_type {
byte first_char;
byte last_char;
short height_above_baseline;
short height_below_baseline;
short space_between_lines;
short space_between_chars;
chtab_type* chtab;
} font_type;
Code: Select all
typedef struct rawfont_type {
byte first_char;
byte last_char;
short height_above_baseline;
short height_below_baseline;
short space_between_lines;
short space_between_chars;
word offsets[0];
} rawfont_type;
Code: Select all
typedef struct image_data_type {
Uint16 height;
Uint16 width;
Uint16 flags;
byte data[0];
} image_data_type;
Code: Select all
seg_font:01A8 07 00 char_32 dw 7 ; DATA XREF: seg_font:tbl_font_offso
seg_font:01AA 06 00 dw 6
seg_font:01AC 01 00 dw 1
seg_font:01AE 78 CC 0C 18 30 60 FC db 1111000b
seg_font:01AE db 11001100b
seg_font:01AE db 1100b
seg_font:01AE db 11000b
seg_font:01AE db 110000b
seg_font:01AE db 1100000b
seg_font:01AE db 11111100b
seg_font:01B5 07 00 char_33 dw 7 ; DATA XREF: seg_font:tbl_font_offso
seg_font:01B7 06 00 dw 6
seg_font:01B9 01 00 dw 1
seg_font:01BB 78 CC 0C 18 0C CC 78 db 1111000b
seg_font:01BB db 11001100b
seg_font:01BB db 1100b
seg_font:01BB db 11000b
seg_font:01BB db 1100b
seg_font:01BB db 11001100b
seg_font:01BB db 1111000b
seg_font:01C2 07 00 char_34 dw 7 ; DATA XREF: seg_font:tbl_font_offso
seg_font:01C4 07 00 dw 7
seg_font:01C6 01 00 dw 1
seg_font:01C8 1C 3C 6C CC FE 0C 0C db 11100b
seg_font:01C8 db 111100b
seg_font:01C8 db 1101100b
seg_font:01C8 db 11001100b
seg_font:01C8 db 11111110b
seg_font:01C8 db 1100b
seg_font:01C8 db 1100b
Correct.Falcury wrote: The character glyphs are stored using 1 bit per pixel,
Not true.Falcury wrote: 1 byte per row (so font characters can never be more than 8 pixels wide).
Correct.Falcury wrote: If you want to take a look for yourself, look in David's PRINCE.EXE disassembly, at the seg_font segment.
If I'm not mistaken, the hc_font_data byte array came directly from there!
Done.oitofelix wrote:Please move this discussion to an appropriate thread, probably in SDLPoP's forum.
It also looks like that in the original version: Showing the characters from 0x7F to 0x83.Norbert wrote:Maybe the partial underscoring of ALT was caused by an export bug?
Code: Select all
seg_font:05A7 08 00 char_81 dw 8 ; height in pixels
seg_font:05A9 10 00 dw 10h ; width in pixels
seg_font:05AB 02 00 dw 2 ; width in bytes
seg_font:05AD 7F FE CD C7 B5 EF B5+ db 1111111b,11111110b ; 1
seg_font:05AD EF 85 EF B5 EF B4 6F db 11001101b,11000111b ; 2
seg_font:05AD db 10110101b,11101111b ; 3
seg_font:05AD db 10110101b,11101111b ; 4
seg_font:05AD db 10000101b,11101111b ; 5
seg_font:05AD db 10110101b,11101111b ; 6
seg_font:05AD db 10110100b, 1101111b ; 7
seg_font:05BB 08 00 char_82 dw 8
seg_font:05BD 13 00 dw 13h
seg_font:05BF 03 00 dw 3
Interesting.David wrote:The ALT glyph is marked as 8 pixels tall, but the 8th row is missing, thus the header of the next glyph is used as 8th row.