[File] [PATCH] Magdir/fonts PostScript Type 1 font program data without fontname
Christos Zoulas
christos at zoulas.com
Fri Nov 19 15:52:49 UTC 2021
Committed, thanks!
christos
> On Nov 18, 2021, at 6:07 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. In font directory
> of that software i found files with PFB extensions.
>
> When running running file command version 5.41 on these and more
> such examples i get an output like:
>
> CASLONOP.PFB: PostScript Type 1 font program data
> DarkGardenMK.pfb: PostScript Type 1 font program data
> (DarkGardenMK 1.1)
> FETTEFRK.PFB: PostScript Type 1 font program data
> FRANKFRT.PFB: PostScript Type 1 font program data
> (%CreationDate:
> Fri Aug 28 16:35:24 1992)
> KAUFMANN.PFB: PostScript Type 1 font program data
> LG______.PFB: PostScript Type 1 font program data
> (LetterGothic 001.003)
> LINCOLN.PFB: PostScript Type 1 font program data
> LITHOS.PFB: PostScript Type 1 font program data
> (%CreationDate:
> Sat Aug 29 15:47:14 1992)
> MESOZIC.PFB: PostScript Type 1 font program data
> MIRROR__.PFB: data
> OLD_TOWN.PFB: PostScript Type 1 font program data
> PLAYBI__.PFB: data
> c0583bt_.pfb: PostScript Type 1 font program data
> (%CreationDate:
> Sun Nov 4 19:31:10 1990)
> fmt-525-signature-id-816.pfb: PostScript Type 1 font program data
>
> In most cases the font name is shown in parentheses at the end, but
> some times not. Furthermore with --extension option only 3 character
> sequence ??? is shown. With -i option only generic mime type
> application/octet-stream is shown.
>
> For comparison reason i run the file format identification utility
> TrID ( See https://mark0.net/soft-trid-e.html). The examples are also
> described correctly by TrID first as "Adobe PostScript Type 1 Font"
> by pfb.trid.xml Furthermore it does not misidentify DROID
> fmt-525-signature-id-816.pfb as font data (See appended
> pfb-trid-v.txt.gz). TrID list the used file name extension PFB and
> with -v option the related URL pointing to used file information.
>
> For comparison reason i also run the file format identification
> utility DROID ( See https://sourceforge.net/projects/droid/). This
> identifies many PFB examples as "Adobe Printer Font Binary" by PUID
> fmt/525 (See appended pfb_droid.csv.gz).
>
> So these informations are now expressed by additional comment lines
> inside Magdir/fonts like:
> # URL: https://en.wikipedia.org/wiki/PostScript_fonts
> # Reference: http://mark0.net/download/triddefs_xml.7z
> # defs/p/pfb.trid.xml
> # http://www.nationalarchives.gov.uk/pronom/fmt/525
>
> In current version many PFB examples are described by lines like:
> 6 string %!PS-AdobeFont-1. PostScript Type 1 font program data
>> 26 string >\0 (%s)
>
> This now becomes like:
> 6 string %!PS-AdobeFont-1.
>> 24 ubyte x PostScript Type 1 font program data
> !:mime font/x-postscript-pfb
> !:ext pfb
>>> 24 ubyte =0x3A
>>>> 26 string >\0 (%s)
>>> 24 ubyte !0x3A
>>>> 25 search/568 /FontName\040/
>>>>> &0 regex [A-Za-z\-]+ (%s)
> After phrase part string like "!PS-AdobeFont-1.0" first check for
> more real content by second test line. By this step invalid DROID
> example fmt-525-signature-id-816.pfb is skipped. Often afterwards
> this is followed by colon (3Ah) and space (20h) and font name (like:
> DarkGardenMK LetterGothic) in examples like DarkGardenMK.pfb and
> LG______.PFB. These "good" examples are handled by first branch. So
> font name with "scale" factor is shown in parentheses like before.
> But in some examples like FRANKFRT.PFB and LITHOS.PFB instead of
> colon a Line Break followed by phrase %%CreationDate occur. So i
> look in second branch for font information by looking for directive
> "/FontName /". This is followed "font name" and def directive. So
> that name is now shown by regular expression surrounded by
> parentheses like in the other branch. Now after tests i display a
> user defined one instead generic mime type application/octet-stream
> and 3 byte file name extension PFB.
>
> Some examples are described by line like:
> 6 string %!FontType1 PostScript Type 1 font program data
> Here no font name is displayed. This is irritating, when some times
> font name is shown and then sometimes not. So now i look for font
> name string. Hoping that my observations are always true this
> together with mime type and file name extension now becomes like:
> 6 string %!FontType1 PostScript Type 1 font program data
> !:mime font/x-postscript-pfb
> !:ext pfb
>
> Then i found one example MIRROR__.PFB where exclamation mark is
> missing. I do not know if this is an accident but i added it by
> lines like:
> 6 string %PS-AdobeFont-1. PostScript Type 1 font program data
> !:mime font/x-postscript-pfb
> !:ext pfb
>
> Then i found one example PLAYBI.PFB where characteristic pattern
> occur later after long postscript comment line. This is now
> described by lines like:
> 230 string %!FontType1 PostScript Type 1 font program data
> !:mime font/x-postscript-pfb
> !:ext pfb
>> 247 string >\0 (%s)
>
> After applying the above mentioned modifications by patch
> file-5.41-fonts-pfb.diff then all my PFB examples (more than
> thousand) are still described with more details (font name) and
> some misidentification vanish. This now looks like:
>
> CASLONOP.PFB: PostScript Type 1 font program data
> (CaslonOpenFace 001.003)
> DarkGardenMK.pfb: PostScript Type 1 font program data
> (DarkGardenMK 1.1)
> FETTEFRK.PFB: PostScript Type 1 font program data
> (FetteFraktur 001.003)
> FRANKFRT.PFB: PostScript Type 1 font program data
> (Frankfurt)
> KAUFMANN.PFB: PostScript Type 1 font program data
> (Kaufmann 001.003)
> LG______.PFB: PostScript Type 1 font program data
> (LetterGothic 001.003)
> LINCOLN.PFB: PostScript Type 1 font program data
> (Linotext 001.003)
> LITHOS.PFB: PostScript Type 1 font program data
> (Lithos)
> MESOZIC.PFB: PostScript Type 1 font program data
> (MesozoicGothic 001.001)
> MIRROR__.PFB: PostScript Type 1 font program data
> (Times-Mirror 001.001)
> OLD_TOWN.PFB: PostScript Type 1 font program data
> (Old-Town 001.003)
> PLAYBI__.PFB: PostScript Type 1 font program data
> (Playbill 001.001)
> c0583bt_.pfb: PostScript Type 1 font program data
> (Courier10PitchBT-Bold)
> fmt-525-signature-id-816.pfb: data
>
> I hope my diff file can be applied in future version of file utility.
>
> There exist 3 more pattern which should identify PFB samples but i
> do not find such examples and that patterns are different from TrID
> and DROID patterns. So i add mime and extension lines as comments
> because i do not know if this is really true.
>
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYZbcnwAKCRCv8rHJQhrU
> 1pTyAJwP99yCbjr4TJcI/7DILaaTOWdknQCg0emTQUEr2v9kAIDSthI0DBqMIi8=
> =1Vyn
> -----END PGP SIGNATURE-----
> <Nachrichtenteil als Anhang.DEFANGED-276><pfb_trid-v.txt.gz><pfb_droid.csv.gz><file-5_41-fonts-pfb_diff.DEFANGED-277><file-5_41-fonts-pfb_diff_sig.DEFANGED-278>--
> 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/20211119/446d5fe1/attachment.asc>
More information about the File
mailing list