Allow for making more lookups support subtabe breaks. Although AFDKO’s
makeotf supports subtable breaks only in pair pos lookups, I believe
that is an implementation limit that we don’t have to follow; all
OpenType lookups has subtables and it should be possible to code that in
the feature files.
* [subset CFF] Fix bug in de-subroutinizing when subroutines contain hints, issue 1493
The code was skipping executing a subroutine if it had already been desubroutinized. The initial set of vstemhm and hstemhm operators and values may be in a subroutine. If a charstring is being executed which calls such subroutines, they still need to be executed in order to count the number of hint values seen, so that the byte length of the hintmask can be calculated.
I fixed this bug by executing subroutines even if they have already been desubroutinized, as long as (we don't know yet if we are doing hintmasks) or ( we do need a hintmask, but have not yet seen it).
Clean up code per Cosimo's suggestions:
In arg list for stop_hint_count(), use *args to accept unused argument, rather than a dummy positional argument.
Change stop_hintcount_ops to a from a global variable to a class variable in _DesubroutinizingT2Decompiler.
Remove un-needed 'return' at line 387
Remove duplicate assignment of cs at line 437
Add patch for the bug where AttributeError is encountered when remove_hints is run after desubroutinize: remove lines deleting the GlobalSubrs for each FontDict. This always needed to be done only once, and is now in any case done in cff.GlobalSubrs.clear(), at the end of the desubroutinize() function.
Changed test case subset_test.py::'test_no_hinting_desubroutinize_CFF' to reference a font with a non-empty GlobalSubr, in order to trigger AttributeError traceback.
* Revert "load_masters: actually assign font attributes"
This reverts commit ef1d4cd02d1e46f5dac3914f547a6e4275cf3077, which caused a
crash in `interpolate_layout()` when `deepcopy`ing OTFs.
Amend code and tests while I work on a real fix.
This is a followup to commit 94633e9f46975c356ec3a2d21ed30768c2fa0cd5,
where I mistakenly made it return an Enum but parse_coverage_() it not
used only for ENUMs and in many (most?) places returning an Enum is
wrong as you have a list of separate items that has to rmain separate.
ValueRecord had a makeString() method that takes an optional “vertical”
argument, but no code outside the tests sets this argument. Renamed it
to asFea() and dropped the “vertical”, so that it consistent with the
rest of feaLib.ast classes.
PROCESS_MARKS followed by a group name is used for markAttachmentType
lookup flag, while followed by MARK_GLYPH_SET is used for
useMarkFilteringSet. The code parsed both correctly but did not
distinguish between the two in the generated AST as it should since they
compile to different lookup flags.
* Fix ast.GroupDefinition.glyphSet() by using ast.GlyphName,
ast.GroupName and ast.Range in Parser.parse_coverage_(), and making it return
ast.Enum.
* Add ast.Enum.__len_() to fix the calculation of max_src and max_dest
in Parser.parse_substitution_(). I’m not sure I understand the logic
of this many to many check, will double check later.
* Update the test suite to reflect this. Had to add ast.Enum.__eq__() to
make it less painful, and __hash__() as otherwise ast.Enum wouldn’t be
used as a key in dicts (not sure this is a goo idea either, will
double check later).