[File] [PATCH] of Magdir/fonts for GEM GDOS font (*.fnt *.gft)
Jörg Jenderek
joerg.jen.der.ek at gmx.net
Sat May 4 20:09:19 UTC 2019
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
some days ago i do some retro stuff. I run version 5.36 on
GEM GDOS fonts with file extension fnt or gft. Such fonts are only
described as "data".
So i add lines to Magdir/fonts. Some Information is found on
fileformats.archiveteam.org website. So add comment line like
# URL: http://fileformats.archiveteam.org/wiki/GEM_bitmap_font
There a link to file format specification is mentioned. So use that as
reference, expressed by comment line like
http://cd.textfiles.com/ataricompendium/BOOK/HTML/APPENDC.HTM#cnt
According to that side for many GEM GDOS fonts lightening mask and
skewing mask has value 5555h ( or UU expressed as ASCII). This is
expressed by magic line
62 ulelong 0x55555555
Separate identifying and displaying part by lines like
>0 use gdos-font
0 name gdos-font
>0 uleshort x GEM GDOS font
Afterwards display file name extension and user defined mime type
by lines:
!:mime application/x-font-gdos
!:ext fnt/gtf
I also find eps file name extension like in example AA070GEP.EPS or
AI360GEP.EPS. Do not know if this is an accident, because normally eps
is used for encapsulated postscript.
Afterwards display font name like "University Bold" in example
S2UNVB18.FNT by line
>4 string x %.32s
Afterwards shown font size, which was in range from 3 in example
SLSS03CG.FNT to 48 in example H1CIRT48.FNT by line
>2 uleshort x %u
Afterwards show unique ID by line
>0 uleshort x \b, ID 0x%4.4x
If mentioned masks are not usual ( not 5555h ) show this by
lines like
>62 uleshort !0x5555 \b, lightening mask 0x%x
>64 uleshort !0x5555 \b, skewing mask 0x%x
Some examples like ROYALK30.GFT have null values for mask fields.
This is expressed bv line
62 ulelong 0
Unfortunately this is not unique enough, but this is not a problem
because identifying and showing parts are separated. So i add addition
al
test lines for such examples. So skip ISO 9660 CD-ROM images with many
nulls by looking for low positive font size by line.
>2 uleshort >2
Highest size for fonts was 48. So check also for upper limit by line
>>2 uleshort <49
So skip misidentified DOS 2.0 backup id file like BACKUPID.@@@.
At this stage some files like MS Windows icons like "download.ico" are
still misidentified. So i also test for valid font name by additional
line
>>>4 ubeshort >0x1F00
For my test collections now identifying is now unique. So now i call
describing part by line
>>>>0 use gdos-font
After applying the above mentioned modifications by patch
file-5.36-fonts-gem.diff then fonts and other test files are described
like:
AI360GEP.EPS: GEM GDOS font Dutch 36, ID 0x000e
BACKM212.COM: DOS executable (COM)
BACKUPID.@@@: DOS 2.0 backup id file, sequence 1, last disk
BOX18.GFT: GEM GDOS font Box Shadow 18, ID 0x0000,
lightening mask 0x0, skewing mask 0x0
COWBOY30.GFT: GEM GDOS font Cowboy 30, ID 0x0000,
lightening mask 0x0, skewing mask 0x0
download.ico: MS Windows icon resource - 1 icon,
32x32, 16 colors, 4 bits/pixel
H1CIRT48.FNT: GEM GDOS font Cirth 48, ID 0x0030
plpbt.iso: ISO 9660 CD-ROM filesystem data
'Plop Boot Manager 5.0.14' (bootable)
ROYALK30.GFT: GEM GDOS font Royal King 30, ID 0x0000,
lightening mask 0x0, skewing mask 0x0
S2UNVB18.FNT: GEM GDOS font University Bold 18, ID 0x0bd4
SLSS03CG.FNT: GEM GDOS font Swiss 3, ID 0x0002
I hope my diff file can be applied in future version of
file utility.
With best wishes
Jörg Jenderek
- --
Jörg Jenderek
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXM3xRQAKCRCv8rHJQhrU
1s4xAKCqNzCpavaVzz1BZdZoQ/cWmUxf5QCgnUdMywYRNySYO8+L3Z7N5eHtXS0=
=2nFV
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.36/magic/Magdir/fonts.old 2018-12-10 20:58:34 +0000
+++ file-5.36/magic/Magdir/fonts 2019-05-04 12:14:38 +0000
@@ -130,2 +130,54 @@
+# From: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/GEM_bitmap_font
+# Reference: http://cd.textfiles.com/ataricompendium/BOOK/HTML/APPENDC.HTM#cnt
+#
+# usual case with lightening mask and skewing mask 5555h~UU
+62 ulelong 0x55555555
+>0 use gdos-font
+# BOX18.GFT COWBOY30.GFT ROYALK30.GFT
+62 ulelong 0
+# skip ISO 9660 CD-ROM ./filesystem by looking for low positive face size
+>2 uleshort >2
+# skip DOS 2.0 backup id file ./msdos by looking for face size lower/equal 48
+>>2 uleshort <49
+# skip MS Windows ICO ./msdos by looking for valid face name
+>>>4 ubeshort >0x1F00
+# skip DOS executable BACKM212.COM by looking for horizontal offset table after header
+#>>>>68 ulelong >87 OFFSET_OK
+>>>>0 use gdos-font
+0 name gdos-font
+>0 uleshort x GEM GDOS font
+!:mime application/x-font-gdos
+# also .eps found like AA070GEP.EPS AI360GEP.EPS
+!:ext fnt/gtf
+# font name like University Bold
+>4 string x %.32s
+# face size in points 3-48
+>2 uleshort x %u
+# face ID (must be unique)
+>0 uleshort x \b, ID 0x%4.4x
+# lowest character index in face (usually 32 for disk-loaded fonts).
+#>36 uleshort x \b, low character index %u
+# width of the widest character
+#>50 uleshort x \b, %u char width
+# width of the widest character cell
+#>52 uleshort x \b, %u cell width
+# thickening size
+#>58 uleshort x \b, %u thick
+# lightening mask to eliminate pixels, usually 5555h
+>62 uleshort !0x5555 \b, lightening mask 0x%x
+# skewing mask to determine when to perform additional rotation when skewing, usually 5555h
+>64 uleshort !0x5555 \b, skewing mask 0x%x
+# offset to horizontal offset table 58h~88 5eh
+#>68 ulelong >88 \b, 0x%x horizontal table offset
+# offset character offset table
+#>72 ulelong x \b, 0x%x coffset
+# offset to font data
+#>72 ulelong x \b, 0x%x foffset
+# form width in bytes
+#>80 uleshort x \b, %u fwidth
+# pointer to the next font, set by GDOS after loading
+#>84 ulelong x \b, 0x%x noffset
+
# downloadable fonts for browser (prints type) anthon at mnt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.36-fonts-gem.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20190504/ca65ab70/attachment.obj>
More information about the File
mailing list