[subset] Subr subsetting fails on some CID-keyed CFF
See original GitHub issueRecently an issue with --no-hinting
was fixed in #709, but I’m getting another error when subsetting a CID-keyed CFF:
$ pyftsubset OurAwesomeUnreleasedFont.otf --no-hinting --text="情"
Traceback (most recent call last):
File "/Users/mnakamura/.pyenv/versions/fonttools-2.7.13/bin/pyftsubset", line 11, in <module>
load_entry_point('fonttools', 'console_scripts', 'pyftsubset')()
File "/Users/mnakamura/.ghq/github.com/mashabow/fonttools/Lib/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/Users/mnakamura/.ghq/github.com/mashabow/fonttools/Lib/fontTools/subset/__init__.py", line 2975, in main
subsetter.subset(font)
File "/Users/mnakamura/.ghq/github.com/mashabow/fonttools/Lib/fontTools/subset/__init__.py", line 2789, in subset
self._prune_post_subset(font)
File "/Users/mnakamura/.ghq/github.com/mashabow/fonttools/Lib/fontTools/subset/__init__.py", line 2772, in _prune_post_subset
retain = table.prune_post_subset(self.options)
File "/Users/mnakamura/.ghq/github.com/mashabow/fonttools/Lib/fontTools/subset/__init__.py", line 2281, in prune_post_subset
subr.subset_subroutines (local_subrs, font.GlobalSubrs)
File "/Users/mnakamura/.ghq/github.com/mashabow/fonttools/Lib/fontTools/subset/__init__.py", line 1917, in subset_subroutines
p[i-1] = subrs._used.index(p[i-1] + subrs._old_bias) - subrs._new_bias
AttributeError: 'list' object has no attribute '_used'
According to Lib/fontTools/subset/__init__.py#L2266-L2281, when processing the GlobalSubrs, the value of local_subrs
is always []
even if there are actually some local subrs. This seems to cause the error in subr.subset_subroutines()
.
Note that this font hasn’t been released yet, so unfortunately we cannot provide samples for now.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
NEWS.rst - third_party/fonttools - Git at Google
[feaLib] Have ``fontTools feaLib`` script exit with error code when build fails (#2459) ... [subset] Speed up subsetting of large CFF fonts (#2467)....
Read more >fonttools [python-library] - Occam :: Details
[merge] Support merging CFF tables (CID-keyed CFF is still not supported) (#2447). ... [subset] Fix subsetting COLRv1 clip boxes when font is loaded...
Read more >fonttools - Python Package Health Analysis - Snyk
[subset] Speed up subsetting of large CFF fonts (#2467). ... Keep advance widths when stripping ".notdef" glyph outline in CID-keyed CFF fonts (#845) ......
Read more >History of Ghostscript versions 6.n - UnixWare 7 Documentation
(ziodevsc.c [1.2]: 2001/03/27 09:37:10 ghostgum) - Avoid rangecheck error when character code exceeds 255. Support zero-size bitmap used by some fonts for ...
Read more >https://jira.reactos.org/secure/attachment/21159/f...
+ + Some large packages using FreeType have to use a broken (deficient) + ... + + * src/cff/cffobjs.c (remove_subset_prefix): Update length after...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Team work \o/
Ah, you just successfully debugged https://github.com/fonttools/fonttools/issues/656 ! Thank you!!! Let me think about this a bit.