robhagemans / monobit

Tools for working with monochrome bitmap fonts
MIT License
208 stars 11 forks source link

Elan Enterprise .fnt files files format for import/export #34

Closed SlashNetUA closed 3 months ago

SlashNetUA commented 3 months ago

Hi! test.zip

Here are the test files for the research. You understand if you look them with any HEX Editor. BIN00 - characters are encoded from 0 to 127. BIN20 - characters are encoded from 32 to 159 (the number corresponds to the value of the ascii-table of the computer). HFONT - normal font.

File size is always 1152. Character size W8*H9. Total number of characters 128.

robhagemans commented 3 months ago

monobit can load HFONT.FNT with ./convert.py HFONT.FNT -format=raw -cell=8x9 -strike-count=128 The .fnt files appear to be character code mappings for each index.

Given that it's fairly straightforward already and there doesn't seem to be distinguishing information or metadata in the files nor in the filenames, I don't see a lot of scope to implement this as a font format by itself... hat is the provenance of these, I imagine this is a character ROM dump? Or is it a format used in multiple files?

SlashNetUA commented 3 months ago

Yes. This is a memory dump that can be freely modified. And in such .fnt files usually store fonts.

Theese sample fonts I create using small basic program (and then dump required memory part):

  100 FOR I=32 TO 159
  110   LET X=I
  120   SET CHARACTER I,X,X,X,X,X,X,X,X,X
  130 NEXT I

Your variant is almost good. Only characters 128-159 are in wrong position.

0-31 - control characters 32-127 - standart ASCII 7bit 128-159 - additional national latin symbols

robhagemans commented 3 months ago

You could do ./convert.py HFONT.FNT -format=raw -cell=8x9 -strike-count=128 label -codepoint-from=128-159,32-127 -overwrite label -char-from=iso646-gb

ISO-646-GB fits well with the 7-bit range, except for 0x7f. Not sure if the rest of the character set is a standard one or specific to Elan Enterprise?

All this functionality isn't very discoverable, sorry - I haven't taken the time to write proper documentation.

SlashNetUA commented 3 months ago

Thanks! It will be helpful.

SlashNetUA commented 3 months ago

One of the original developers of the system (with whom we have a connection) can no longer remember now what the 0x7f character glyph means. :)

robhagemans commented 3 months ago

I think it's just a tilde (like in ASCII), while ISO-646-GB has an overline. Actually it looks like the DEC NRCS for the UK had both a sterling sign and a tilde, so that may be what they used for the 0-127 range. https://en.m.wikipedia.org/wiki/National_Replacement_Character_Set

SlashNetUA commented 3 months ago

7Eh is a tilde, you right.

But 7Fh is another character.

0x7f:
    .@@@....
    .@......
    .@.@@...
    ...@@...
    ...@@@@.
    ...@.@@.
    ...@@@@.
    ........
    ........
robhagemans commented 3 months ago

Ah I see! Looks like "rb".

Given that 0x7f is supposed to be Delete, could it be short for "rub-out"?

On 9 August 2024 17:58:26 BST, SlashNetUA @.***> wrote:

7Eh is a tilde, you right.

But 7Fh is another character.

0x7f:
   .@@@....
   .@......
   .@.@@...
   ...@@...
   ...@@@@.
   ...@.@@.
   ...@@@@.
   ........
   ........

-- Reply to this email directly or view it on GitHub: https://github.com/robhagemans/monobit/issues/34#issuecomment-2278365239 You are receiving this because you commented.

Message ID: @.***>