[File] [PATCH] Magdir/font X11 SNF font misidentfies DEGAS bitmap BIGSPID.PI1

Christos Zoulas christos at zoulas.com
Tue Nov 23 18:20:42 UTC 2021


Committed, thanks!

christos

> On Nov 22, 2021, at 5:55 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> some days ago i installed an older Adobe software with some fonts.
> So i was checking some other font stuff.
> 
> When running running file command version 5.41 on DEGAS images
> examples i get an output like:
> BIGSPID.PI1: X11 SNF font data, MSB first
> 
> Furthermore with --extension option only 3 character sequence ???
> is shown.
> 
> For comparison reason i run the file format identification utility
> TrID ( See https://mark0.net/soft-trid-e.html). The example is not
> recognized as font (See appended trid-v.txt.gz). But in the TrID
> database exist a definition snf-x11-lsb.trid.xml for the little
> endian variant. TrID list the used file name extension SNF.
> 
> Luckily i found on file formats archive team web site a page about
> SNF (Server Normal Format). There also a link to source header file
> snfstr.h with specifications is mentioned.
> So these informations are now expressed by additional comment lines
> inside Magdir/fonts like:
> # URL:		http://fileformats.archiveteam.org/wiki/SNF
> # Reference:	https://cgit.freedesktop.org/xorg/lib/libXfont/
> #		tree/src/bitmap/snfstr.h
> # Reference:    http://mark0.net/download/triddefs_xml.7z
> #		defs/s/snf-x11-lsb.trid.xml
> 
> In current version big endian SNF fonts examples are described by
> lines like:
> 0	belong	00000004	X11 SNF font data, MSB first
> !:mime	application/x-font-sfn
> 
> So 4 bytes are used for recognition, but 3 are zero. So this is no
> so unique enough. The same problem exist for the little endian
> variant which i fixed in February 2013. So according to
> documentation i also
> checked for second version stamp at offset 104 which is the same as
> the first version at the beginning. So this now becomes like:
> 0	belong	00000004
>> 104	belong	00000004		X11 SNF font data, MSB first
> !:mime	application/x-font-sfn
> !:ext	snf
> By this additional second test line misidentified Atari DEGAS low
> resolution bitmap BIGSPID.PI1 now is skipped.
> 
> After applying the above mentioned modifications by patch
> file-5.41-fonts-snf.diff then the misidentification vanish. This
> now looks like:
> BIGSPID.PI1: data
> 
> I hope my diff file can be applied in future version of file utility.
> 
> I will try to add magic for DEGAS bitmap images in the future, but
> it is a little bit difficult because such images have no real
> strong magic pattern. So i must look for sufficient test lines.
> 
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> 
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYZwf3gAKCRCv8rHJQhrU
> 1vI5AKCDrCmJ2yUrtQLTV7WB9CQfD0iF3wCePWFVKIofl/lxzISsGYYMGmBMCXE=
> =1j5i
> -----END PGP SIGNATURE-----
> <file-5_41-fonts-snf_diff.DEFANGED-274><file-5_41-fonts-snf_diff_sig.DEFANGED-275><trid-v.txt.gz>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20211123/a461d625/attachment.asc>


More information about the File mailing list