Author Topic: Errors while parsing "dfont"  (Read 5621 times)

kemsky

  • Jr. Member
  • **
  • Posts: 14
Errors while parsing "dfont"
« on: February 13, 2012, 07:08:35 AM »
Hi, we are using exiftool to extract fontinfo from different fonts, but parsing some dfonts(which are valid on mac and can be installed) produce errors.

1) Windows (Any)

2) 8.77

3) exiftool.exe AppleGothic.dfont , exiftool.exe Keyboard.dfont

4) exiftool.exe AppleGothic.dfont:
Code: [Select]
ExifTool Version Number         : 8.77
File Name                       : AppleGothic.dfont
Directory                       : .
File Size                       : 9.7 MB
File Modification Date/Time     : 2002:07:14 12:30:58+03:00
File Permissions                : rw-rw-rw-
File Type                       : RSRC
MIME Type                       : application/ResEdit
Warning                         : Error reading sfnt resource
Application Version             : KH-4.0d2, 2002

exiftool.exe Keyboard.dfont:
Code: [Select]
ExifTool Version Number         : 8.77
File Name                       : Keyboard.dfont
Directory                       : .
File Size                       : 21 kB
File Modification Date/Time     : 2002:07:19 04:02:46+03:00
File Permissions                : rw-rw-rw-
File Type                       : DFONT
MIME Type                       : application/x-dfont
Warning                         : Unrecognized sfnt resource format
Application Version             : 4.0d4, 2002

download fonts: http://www.mediafire.com/?l68t6lxnu6heq8k

other software we tried:
google sfntly http://code.google.com/p/sfntly/   -failed
http://www.markdouma.com/developer/ResourceFinagler.zip - failed
http://peter.upfold.org.uk/projects/dfontsplitter - converted dfont to ttf and then exiftool parsed it correctly

thanks.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14937
    • ExifTool Home Page
Re: Errors while parsing "dfont"
« Reply #1 on: February 13, 2012, 07:25:38 AM »
If you send me the sample font files I'll take a look.  My email is phil at owl.phy.queensu.ca

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kemsky

  • Jr. Member
  • **
  • Posts: 14
Re: Errors while parsing "dfont"
« Reply #2 on: February 13, 2012, 07:51:25 AM »
I've just sent email, you can also use this link http://www.mediafire.com/?l68t6lxnu6heq8k

thanks

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14937
    • ExifTool Home Page
Re: Errors while parsing "dfont"
« Reply #3 on: February 13, 2012, 08:25:01 AM »
Great, thanks.

ExifTool 8.79 will fix these problems:

AppleGothic.dfont: The sfnt resource was larger than an arbitrary size limit that I had imposed to avoid allocating too much memory if the file was corrupted.  The limit I set was 1 MB, but the sfnt resource in this file is 10 MB.  I will increase the size limit to 100 MB.

Keyboard.dfont: This sfnt resource was of type "•kbd" -- a type I wasn't aware of, but it seems to have the same format as a standard TrueType font ("true"), so I'll add recognition of this type.

Also, in my search for documentation on the "•kbd" type, I also found that Apple's LastResort.dfont uses type "•lst", so I will add support for this too.  It seems that Apple takes a few liberties with their own font type specification because I don't think that these two types are documented.

Thanks again for the bug report, and for the samples.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kemsky

  • Jr. Member
  • **
  • Posts: 14
Re: Errors while parsing "dfont"
« Reply #4 on: February 13, 2012, 08:56:00 AM »
We will test 8.79 version on our other failed fonts and report here.

thanks)

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14937
    • ExifTool Home Page
Re: Errors while parsing "dfont"
« Reply #5 on: February 13, 2012, 12:17:49 PM »
In case you can run the pure Perl version of ExifTool, I have made an 8.79 pre-release available here in hopes you can test the other font files before the official release.

But we will have to wait for the official release if you rely on the Windows .exe version of ExifTool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kemsky

  • Jr. Member
  • **
  • Posts: 14
Re: Errors while parsing "dfont"
« Reply #6 on: February 14, 2012, 03:05:31 AM »
8.79 pre-release works great, thank you.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14937
    • ExifTool Home Page
Re: Errors while parsing "dfont"
« Reply #7 on: February 14, 2012, 07:17:03 AM »
Excellent!  Thanks for testing this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kemsky

  • Jr. Member
  • **
  • Posts: 14
Re: Errors while parsing "dfont"
« Reply #8 on: March 11, 2012, 09:31:35 AM »
Hi, Phil
we have found few fonts that cant be parsed.

These fonts were stored in resource fork on mac, then they were copied to another network share (2 files, Apple Double Format), then we extracted resource stream and run exiftool on it and it failed, but I've successfully converted extracted resource stream to pfb (it seems that dfont was used as container for pfb... but i dont know) using dfontsplitter (see first post) and run exiftool without problems.


Using exiftool version 8.79.

1. Extracted reasource stream as LucidSan.dfont:
exiftool.exe LucidSan.dfont
Code: [Select]
ExifTool Version Number         : 8.79
File Name                       : LucidSan.dfont
Directory                       : .
File Size                       : 29 kB
File Modification Date/Time     : 2012:03:11 15:49:53+02:00
File Permissions                : rw-rw-rw-
File Type                       : RSRC
MIME Type                       : application/ResEdit

Converted LucidSan.dfont to LucidaSans.pfb with dfontsplitter:
exiftool.exe LucidSan.pfb
Code: [Select]
ExifTool Version Number         : 8.79
File Name                       : LucidaSans.pfb
Directory                       : .
File Size                       : 29 kB
File Modification Date/Time     : 2012:03:11 15:51:30+02:00
File Permissions                : rw-rw-rw-
File Type                       : PFB
MIME Type                       : application/x-font-type1
Create Date                     : Wed Dec 30 10:10:33 1987
Comment                         : 1.Copyright (c) 1986 Bigelow & Holmes. .Lucida is a registered trademark of Bigelow & Holmes.
Version                         : 001.000
Notice                          : Copyright (c) 1987 Adobe Systems Incorporated. All rights reserved.Lucida is a registered trademark of Bigelow & Holmes.
Copyright                       :  Copyright (c) 1986 Bigelow & Holmes.
Full Name                       : Lucida Sans Roman
Font Family                     : LucidaSans
Weight                          : Medium
Italic Angle                    : 0
Is Fixed Pitch                  : false
Underline Position              : -30
Underline Thickness             : 60
Font Name                       : LucidaSans
Font Type                       : 1

You can download examples here fonts.zip


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14937
    • ExifTool Home Page
Re: Errors while parsing "dfont"
« Reply #9 on: March 11, 2012, 07:40:15 PM »
Thanks for the samples.

I hadn't previously seen this type of dfont file.  The font information is stored in a "POST" resource instead of an "sfnt" resource, and is in PostScript format.

I will add support for this type of dfont file in ExifTool 8.82.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kemsky

  • Jr. Member
  • **
  • Posts: 14
Re: Errors while parsing "dfont"
« Reply #10 on: March 13, 2012, 08:57:53 AM »
thanks again :)

8.82 identifies all fonts we have currently.