fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
557 stars 103 forks source link

investigate BLACKLISTED: Corben #705

Closed felipesanches closed 8 years ago

felipesanches commented 8 years ago

blacklisted on font_compare_metrics.py (Issue #684)

fontfile: '../../github_google/fonts/ofl/corben/Corben-Bold.ttf'
Traceback (most recent call last):
  File "tools/compute_font_metrics.py", line 269, in <module>
    main()
  File "tools/compute_font_metrics.py", line 127, in main
    properties.append(get_width(fontfile))
  File "tools/compute_font_metrics.py", line 219, in get_width
    text_width, text_height = font.getsize(TEXT)
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 143, in getsize
    return self.font.getsize(text)[0]
IOError: invalid reference
graphicore commented 8 years ago

Here's the reason: https://github.com/google/fonts/issues/132#issuecomment-244796023

We may add a check that looks if all TrueType instructions tables are present if one is present. I guess it's hard to determine the actual dependencies of a table like prep. So, prep, cvt and fpgm would have to be there all together or none at all.

At least in https://www.freetype.org/ttfautohint/doc/ttfautohint.html#sfnt-tables it says:

cvt, prep, and fpgm: These tables get replaced with data necessary for the new hinting bytecode.

So, ttfautohint would always create all three of these. I'm a bit afraid that this check could be too much of a hammer though. Thoughts?

felipesanches commented 8 years ago

Thanks, @graphicore !

felipesanches commented 7 years ago

So, ttfautohint would always create all three of these. I'm a bit afraid that this check could be too much of a hammer though. Thoughts?

Yes, auto-blacklisting any font that lacks one or more of the three tables (but has at least one of them) is too much. It means we end up auto-blacklisting 2185 font files (while the collection has a total of aproximately 2400 TTF files). So yeah, it auto-blacklists almost everything!

I removed the auto-blacklisting and noticed that this specific problems happens only with Corben-Bold, while the other problems detected last year were solves except for these:

#IOError: execution context too long (issue #703)
  "Padauk",
  "KumarOne",

#ZeroDivisionError: float division by zero
  "AdobeBlank",
  "Phetsarath",

# IOError: invalid reference See also: https://github.com/google/fonts/issues/132#issuecomment-244796023
  "Corben", 

# IOError: stack overflow on text_width, text_height = font.getsize(TEXT) 
  "Rubik",