625 Commits

Author SHA1 Message Date
Khaled Hosny
cc1b6baff7 [feaLib] "subtable" in contextual positioning 2019-03-01 01:48:48 +02:00
Khaled Hosny
47d30499a5 [feaLib] "subtable" in contextual substitution 2019-03-01 01:48:48 +02:00
Khaled Hosny
6bb0545655 [feaLib] Don’t hard-code "subtable" support
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.
2019-03-01 01:48:48 +02:00
Chris Simpkins
16bb3fd605 [varLib.mutator] set OVERLAP_SIMPLE and OVERLAP_COMPOUND by default in instantiateVariableFont (#1518) 2019-02-28 09:34:43 -08:00
Cosimo Lupo
0475246eef designspaceLib_test: fix test_normalization4 expected results 2019-02-27 15:17:24 -08:00
Khaled Hosny
1a0aec4c56 [feaLib] Add forceChain to MultipleSubstStatement
For consistency with other substitution statements.
2019-02-19 18:59:58 +02:00
Read Roberts
7ae6ca8106 [subset CFF] Fix de-subroutinizing bug when subroutines contain hints (#1499)
* [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.
2019-02-18 09:43:27 +00:00
Cosimo Lupo
dda4c1a41e svgLib: rename PathBuilder's 'pathes' attribute to 'paths' 2019-02-14 17:18:33 +00:00
Cosimo Lupo
813826f68c Merge pull request #1500 from rsheeter/master into svg-shapes 2019-02-14 17:11:51 +00:00
punchcutter
da5b1500b9 Read special case of contextual positioning. 2019-02-12 12:35:34 -08:00
Rod Sheeter
4f318045fd Merge remote-tracking branch 'upstream/master' 2019-02-12 11:53:52 -08:00
Rod Sheeter
416da67fdd Try to follow FT coding style 2019-02-12 11:53:27 -08:00
Khaled Hosny
c3f3606c59 [feaLib] Allow hyphen in glyph class names
Matches AFDKO’s makeotf behaviour.
2019-02-10 14:31:37 +02:00
Rod Sheeter
199aa9e24b Rudimentary decimal support 2019-02-08 14:59:28 -08:00
Rod Sheeter
1e70458679 More simple shape examples 2019-02-08 13:11:33 -08:00
Rod Sheeter
d910ba371b Wire SVGPath to import other shapes 2019-02-08 11:37:00 -08:00
Rod Sheeter
1292029be2 test for basic rounded rect 2019-02-08 10:50:22 -08:00
Rod Sheeter
f0e8e72187 Test wiring for <rect> import 2019-02-08 10:06:14 -08:00
Nikolaus Waxweiler
e50733df21 Make simpler test in cffLib tests 2019-02-05 14:33:58 +00:00
Nikolaus Waxweiler
3011f3b7d4 Add smoke-test for layout interpolation of OTFs 2019-02-05 13:57:01 +00:00
Nikolaus Waxweiler
8bff72139c Reinstate fixed load_masters() 2019-02-05 13:02:53 +00:00
Nikolaus Waxweiler
1e746e34ee
Revert "load_masters: actually assign font attributes" (#1486)
* 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.
2019-02-05 11:38:46 +00:00
Khaled Hosny
b68596cc80 [feaLib] Add an ast test for the previous commit 2019-02-05 13:10:33 +02:00
Nikolaus Waxweiler
376b904352
Merge pull request #1477 from madig/varLib-sparse-master-MVAR-generation
[varLib] Fix MVAR generation for sparse masters

Also actually assign loaded fonts to the `.font` attribute in `load_masters`.
2019-02-04 16:48:33 +00:00
Nikolaus Waxweiler
63a56b98fd _add_MVAR: set model only once, after a tables have been fetched 2019-02-04 16:03:47 +00:00
Khaled Hosny
cedf79b505 [voltLib] Return a tuple from parse_coverage_()
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.
2019-02-02 01:13:14 +02:00
Khaled Hosny
354b89c068 [feaLib] Implement ValueRecord.asFea()
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.
2019-01-28 11:52:36 +02:00
Khaled Hosny
e974ea3871 [feaLib] Add tests for ValueRecordDefinition.asFea()
Currently fail as it calls ValueRecord.asFea() which is not implemented.
2019-01-28 11:52:36 +02:00
Khaled Hosny
f48f4cc6b4 [feaLib] Round-trip useExtension keyword 2019-01-27 12:16:35 +02:00
Denis Moyogo Jacquerye
18ac453781
Merge pull request #1467 from khaledhosny/voltlib-glyph-type
[voltLib] Accept COMPONENT glyph type
2019-01-24 14:24:18 +00:00
Khaled Hosny
c5bbd39577 [voltLib] Add test for MARK glyph type 2019-01-24 13:59:06 +02:00
Khaled Hosny
cd553debc3 [voltLib] Accept COMPONENT glyph type 2019-01-24 13:55:53 +02:00
Cosimo Lupo
1bb55b5c7e
Merge pull request #1464 from anthrotype/svg-path-arc-to-cubic
svgLib: add support for converting elliptical arcs to cubic bezier curves
2019-01-24 12:25:49 +01:00
Cosimo Lupo
fd219f5d93
add tests for parsing SVG arcs 2019-01-24 11:16:49 +00:00
Khaled Hosny
098ce94edb Minor 2019-01-23 10:18:44 +02:00
Khaled Hosny
b6ec12bad0 [voltLib] Distinguish different PROCESS_MARKS
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.
2019-01-23 10:18:44 +02:00
Sascha Brawer
6a7e299c09 Fix “DeprecationWarning: invalid escape sequence” in Python 3.7 2019-01-22 16:36:15 +01:00
Khaled Hosny
4236772ec1 [voltLib] glyphSet() should return tuple
We need to maintain the glyph order and keep any duplicates.
2019-01-22 09:42:22 +02:00
Khaled Hosny
94633e9f46 [voltLib] Fix parsing glyph groups
* 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).
2019-01-22 09:42:22 +02:00
Cosimo Lupo
baf11f64f4
feaLib/builder_test: add test for #1459 2019-01-19 12:17:38 +00:00
Cosimo Lupo
091b05296d
[feaLib] distinguish missing value and explicit '<NULL>' for PairPos2 format A
Fixes #1459
2019-01-19 11:46:05 +00:00
Cosimo Lupo
0e47ea1fac
[ttx] add --no-recalc-timestamp option to keep original head.modified
Fixes #46
2019-01-17 13:26:59 +00:00
Khaled Hosny
e529832362 [voltLib] Don’t try to read past END
The parser was still trying to read the next token even when the current
token was END, but I think it should just stop reading here. When
reading from TSIV table there can be null bytes at the end when would
cause an exception in the lexer.
2019-01-16 23:04:14 +02:00
Cosimo Lupo
a3dd59d6ea
Merge pull request #1447 from anthrotype/retain-gids-cff
[subset] set emptied CFF charstrings to 'endchar' with --retain-gids
2019-01-16 16:51:57 +00:00
Cosimo Lupo
1cde186172
subset_test: add test for --retain-gids and CFF2 table 2019-01-16 16:02:07 +00:00
Khaled Hosny
ca716e0925 [voltLib] Fix check for duplicate anchors
When checking for duplicate anchors, the component number should be
taken into account since the same anchors can be used for different
components i.e. over ligatures.
2019-01-16 15:31:05 +02:00
Cosimo Lupo
7740d1736c
varLib_test: add test for sparse masters 2019-01-16 11:25:29 +00:00
Cosimo Lupo
336abfcaf0
[subset] set charstring's effective width to 0 when --retain-gids
seems to be the consensus, despite this may add a few bytes when
the emptied glyph's width is different from PrivateDict.defaultWidthX
2019-01-15 15:24:26 +00:00
Cosimo Lupo
af1a0d1fe5
[subset] set emptied CFF charstrings to 'endchar' with --retain-gids
Part of #1446
2019-01-15 14:07:54 +00:00
Cosimo Lupo
71dbe2daea
subset_test: add test for --retain-gids option 2019-01-15 11:31:28 +00:00