TTX error

77 views
Skip to first unread message

Jeremy Mickel

unread,
Oct 31, 2013, 5:11:22 PM10/31/13
to rob...@googlegroups.com
I've noticed a strange phenomenon lately -- If I input an OTF using TTX, it spits out a TTX document. But then if I input that TTX document to regenerate the font, it exports as a TTF. 

The TTF isn't installable, but if I change the file extension to OTF, it's a usable font.

It's been happening for a few weeks now in OSX 10.8. I recently upgraded to OSX 10.9 and it still happens, even after reinstalling FontTools.

Thanks for any ideas on what might be wrong!

Jeremy

Dave Crossland

unread,
Oct 31, 2013, 5:42:07 PM10/31/13
to rob...@googlegroups.com
Which version of ttx is that?

Behdad Esfahbod

unread,
Oct 31, 2013, 8:43:00 PM10/31/13
to rob...@googlegroups.com, fonttools
[+fonttools]

On 13-10-31 09:11 PM, Jeremy Mickel wrote:
> I've noticed a strange phenomenon lately -- If I input an OTF using TTX, it
> spits out a TTX document. But then if I input that TTX document to regenerate
> the font, it exports as a TTF.

Looks to me like this have been broken forever... The following patch fixes it:

diff --git a/Lib/fontTools/ttx.py b/Lib/fontTools/ttx.py
index 6cef64a..56f211a 100644
--- a/Lib/fontTools/ttx.py
+++ b/Lib/fontTools/ttx.py
@@ -267,7 +267,7 @@ def guessFileType(fileName):
elif head in ("\0\1\0\0", "true"):
return "TTF"
elif head.lower() == "<?xm":
- if opentypeheaderRE.match(header):
+ if opentypeheaderRE.search(header):
return "OTX"
else:
return "TTX"


I'll push a fix in my tree.


> The TTF isn't installable, but if I change the file extension to OTF, it's a
> usable font.
>
> It's been happening for a few weeks now in OSX 10.8. I recently upgraded to
> OSX 10.9 and it still happens, even after reinstalling FontTools.
>
> Thanks for any ideas on what might be wrong!
>
> Jeremy
>
> --
> --
> You received this message because you are subscribed to the Google Groups
> "RoboFab" group.
> To post to this group, send email to rob...@googlegroups.com
> To unsubscribe from this group, send email to robofab-u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/robofab?hl=en
>
> Messages from newly joined members are subject to moderation.
> Download RoboFab and documentation at http://robofab.com
> ---
> You received this message because you are subscribed to the Google Groups
> "RoboFab" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to robofab+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
behdad
http://behdad.org/

Ben Kiel

unread,
Oct 31, 2013, 8:58:29 PM10/31/13
to rob...@googlegroups.com
Jeremy,

What version does doing ttx -h give you?

Best,
Ben

Jeremy Mickel

unread,
Nov 1, 2013, 1:58:09 AM11/1/13
to rob...@googlegroups.com
Thanks guys. I'm using TTX 2.4

j

Ben Kiel

unread,
Nov 1, 2013, 10:58:34 AM11/1/13
to rob...@googlegroups.com
Jeremy,

It looks the the Regex was changed in 2.4 for detecting TTF vs OTF, and that seems like it might be the cause. If you recently switched from 2.3 to 2.4 that would be the reason.

I'm terrible at regex, so I'm not 100% sure, but that did change in 2.4 and is at the heart of the patch Behdad sent. I use TTX a lot, 2.3, and haven't ever had the problem you describe, so that's my best guess.

Try installing 2.3 and it should do the trick.

Best,
Ben

Dave Crossland

unread,
Nov 1, 2013, 1:19:19 PM11/1/13
to rob...@googlegroups.com
On 1 November 2013 10:58, Ben Kiel <b...@benkiel.com> wrote:
> Try installing 2.3 and it should do the trick.

Or install Behdad's version from https://github.com/behdad/fonttools/
which has many other improvements :)

Erik van Blokland

unread,
Nov 1, 2013, 1:37:27 PM11/1/13
to rob...@googlegroups.com
.. And dependencies. When are we going to have a talk about those?

Erik

Behdad Esfahbod

unread,
Nov 1, 2013, 2:18:23 PM11/1/13
to rob...@googlegroups.com
On 13-11-01 05:37 PM, Erik van Blokland wrote:
>
>
>
>> On 1 nov. 2013, at 18:19, Dave Crossland <da...@lab6.com> wrote:
>>
>>> On 1 November 2013 10:58, Ben Kiel <b...@benkiel.com> wrote:
>>> Try installing 2.3 and it should do the trick.
>>
>> Or install Behdad's version from https://github.com/behdad/fonttools/
>> which has many other improvements :)
>
> .. And dependencies. When are we going to have a talk about those?

I don't understand. What kinds of dependencies? I'd love to hear your
thoughts on the list I set up specifically for this purpose:

https://groups.google.com/d/forum/fonttools

Regards,
--
behdad
http://behdad.org/
Reply all
Reply to author
Forward
0 new messages