Way to check for TT/PS outline type in FontLab?
Options

yanone
Posts: 134
Hi,
my FontLab under Windows crashes (as in: dies) upon loading a glyph’s TTH program on a glyph that has PS outlines.
But I can’t seem to find a way to query the outline type.
Presence/absence of TT hints, number of off-curve points per segment, contour direction... None seem to be a reliable indicator. g.isContourClockwise() will work a bit, until the contour direction is accidentally wrong.
Whatever is covered under the TRUETYPE-DATA section of the Unofficial FontLab/Python API Reference returns identical values for both types.
Any ideas? Thank you.
my FontLab under Windows crashes (as in: dies) upon loading a glyph’s TTH program on a glyph that has PS outlines.
But I can’t seem to find a way to query the outline type.
Presence/absence of TT hints, number of off-curve points per segment, contour direction... None seem to be a reliable indicator. g.isContourClockwise() will work a bit, until the contour direction is accidentally wrong.
Whatever is covered under the TRUETYPE-DATA section of the Unofficial FontLab/Python API Reference returns identical values for both types.
Any ideas? Thank you.
0
Comments
-
Found FontLab's mistake, although it's a bit hard to believe:
It crashed on a line querying the existence of a glyph object in a variable that was None beforehand.
This works: if self.sourcePSglyph != None:
This doesn't: if self.sourcePSglyph:
But the question above remains interesting.0 -
It may indeed be a FL error. But those two tests are not the same in Python.
See http://stackoverflow.com/a/280670 -
FYI, the same crash occurs if you check for the existence of data in the FL mask layer:
if g.naked().mask: # BOOM! if g.naked().mask != None: # this works
Matthew is correct about the difference between these two tests, but it does not explain why FL unexpectedly quits in this case.0
Categories
- All Categories
- 46 Introductions
- 3.8K Typeface Design
- 476 Type Design Critiques
- 555 Type Design Software
- 1.1K Type Design Technique & Theory
- 640 Type Business
- 831 Font Technology
- 29 Punchcutting
- 508 Typography
- 120 Type Education
- 313 Type History
- 75 Type Resources
- 109 Lettering and Calligraphy
- 30 Lettering Critiques
- 79 Lettering Technique & Theory
- 533 Announcements
- 86 Events
- 110 Job Postings
- 167 Type Releases
- 169 Miscellaneous News
- 274 About TypeDrawers
- 53 TypeDrawers Announcements
- 119 Suggestions and Bug Reports