Page 1 of 1

No file magic for truetype files?

Posted: 2010-05-30T11:14:47-07:00
by Wolfgang Woehl
$ display /usr/share/fonts/truetype/freefont/FreeMono.ttf (displays font summary)
$ cp /usr/share/fonts/truetype/freefont/FreeMono.ttf foo
$ display foo
display: no decode delegate for this image format `foo' @ constitute.c/ReadImage/530.
$ mv foo foo.ttf
$ display foo.ttf (displays font summary)

This -- somewhat -- matters when handling font resources for digital cinema. Those might have uuid filenames:

$ file 3dec6dc0-39d0-498d-97d0-928d2eb78391
3dec6dc0-39d0-498d-97d0-928d2eb78391: TrueType font data

This with ImageMagick 6.5.7-8 2009-11-26 Q16 (Ubuntu 10.04's default, unfortunately)

Re: No file magic for truetype files?

Posted: 2010-05-30T15:34:11-07:00
by fmw42
I suspect IM looks to the file suffix to decide what delegate library to use to display the image. Since foo has no suffix, IM says it does not have the delegate library to handle this. Don't know if this helps you or not.

Re: No file magic for truetype files?

Posted: 2010-05-30T23:08:43-07:00
by Wolfgang Woehl
Fred, yes, obviously. I tend to think that IM's display of fonts should be aligned with the behaviour for image files (where suffixes are not relevant for finding the right delegate and file magic is used instead. But then again, maybe it's done differently?)

Re: No file magic for truetype files?

Posted: 2010-05-31T10:52:25-07:00
by fmw42
I can only assume it has something to do with the X11 display. But I understand your thoughts.

Re: No file magic for truetype files?

Posted: 2010-05-31T11:35:47-07:00
by magick
Add this to your magic.xml configuration file:
  • <magic name="TTF" offset="0" target="\000\001\000\000"/>

Re: No file magic for truetype files?

Posted: 2010-05-31T22:39:03-07:00
by Wolfgang Woehl
Thanks. Works. Should've RTFM.