691 Commits

Author SHA1 Message Date
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
Cosimo Lupo
b2fac2333e
[varLib] allow loading masters from TTX files as well
in a designspace document, the sources' filename attribute can now contain
a relative path to a .TTX file for that master, in addition to .TTF or .UFO
(the latter, resolved through a master_finder callable as before).
2019-01-14 16:32:51 +00:00
Cosimo Lupo
8350332461
{v,h}mtx: allow to compile/decompile even without {v,h}hhea table
when no horizontal/vertical header table is present, we assume numberOfHMetrics == maxp.numGlyphs.
This allows to compile/decompile incomplete fonts, only containing head, maxp, hmtx, loca and glyf (or CFF),
that is the bare minimum to temporarily store glyph outline and metrics data for use with sparse/intermediate
master TTFs in varLib.
See https://github.com/googlei18n/ufo2ft/issues/308
2019-01-14 13:45:24 +00:00
Cosimo Lupo
fe19178ff0
Merge pull request #1438 from anthrotype/enable-varLib-labelNames
[varLib] use addMultilingualName method to support localized axis and instance names
2019-01-13 17:07:31 +00:00
Cosimo Lupo
57f6e310f3
varLib_test: test axes with non-english labelnames 2019-01-13 13:43:00 +00:00
Just van Rossum
6f7c0f1d09
[ttLib] cmap format 14 cleanup (#1437)
* cleanup cmap format 14 TTX format by removing redundant attributes
* don't output the name attr for a default mapping, instead of a glyph named 'None'
* still accept 'None' as an indicator glyph name, for bw compatibility
* swap order of TTX attrs uv and uvs
* make sure (unicode, glyphName) pairs are always tuples in uvsDict.
2019-01-10 19:19:35 +01:00
Just van Rossum
855378477f
[ttLib] adding a test for cmap format 14 (unicode variation sequences) (#1436)
Adding a test for cmap format 14 (unicode variation sequences), in preparation for #1435
2019-01-10 16:48:10 +01:00
justvanrossum
1a8cccc818 explicitly test glyphName = None 2019-01-09 16:14:22 +01:00
justvanrossum
863bdb60c8 allow dumping/verifying a custom subset of the tables 2019-01-09 15:02:48 +01:00
justvanrossum
391f7a76c0 added support for cmap format 14 Unicode Variation Sequences 2019-01-09 14:53:35 +01:00
Cosimo Lupo
eb6ee2cdd3
Merge pull request #1431 from fonttools/fontbuilder-no-mac-names
fontBuilder: add options to setupNameTable to disable Mac (or Win) names
2019-01-07 11:10:18 +00:00
Cosimo Lupo
44b1613cad
Merge pull request #1430 from rsms/cff-encode-float
Fixes bug in misc.psCharStrings.encodeFloat and adds test
2019-01-07 11:09:09 +00:00
Cosimo Lupo
c8cc5e718a
Revert "Merge pull request #1429 from rsms/misc-encodeFloat-test"
This reverts commit 3f1956949a55870a97c75a27dbe59b8d617d587e, reversing
changes made to dc4600856201650d199bf7e2eddc28ba6e7aa970.
2019-01-07 11:07:17 +00:00
Cosimo Lupo
3f1956949a
Merge pull request #1429 from rsms/misc-encodeFloat-test
Adds test for misc.psCharStrings.encodeFloat that exposes a bug
2019-01-07 11:00:49 +00:00
Cosimo Lupo
68e918d32b
fontBuilder: add options to setupNameTable to disable Mac (or Win) names
as of https://github.com/fonttools/fonttools/pull/1359, both sets of names are added by
default. This allows users to optionally exclude Macintosh platform names (i.e. mac=False).
2019-01-07 10:46:48 +00:00
Cosimo Lupo
dc46008562
fontBuilder_test: Fix up expected test data for test_var.otf.ttx
after merging #1359
2019-01-07 10:36:34 +00:00
Cosimo Lupo
683547dde2
Merge pull request #1359 from justvanrossum/addmultilingualnames-mac
[name] make addMultilingualNames() add mac names by default
2019-01-07 09:54:34 +00:00
Rasmus Andersson
4c72b8f781 Change precision to 8 digits to match AFDKO 2019-01-05 11:06:59 -08:00
Rasmus Andersson
768f8ec171 Fixes bug in misc.psCharStrings.encodeFloat and adds test 2019-01-04 15:48:14 -08:00
Rasmus Andersson
86461d6281 Adds test for misc.psCharStrings.encodeFloat that exposes a bug with "E+" 2019-01-04 15:13:01 -08:00
Cosimo Lupo
448b946636
varLib/designspaceLib: require font-less source to have a path; remove getSourcePath
simpler is better. Also, refactored updatePaths and added more tests to it.
2019-01-03 14:21:09 +00:00
Cosimo Lupo
7d688ff18a
varLib_test: read TTFonts from compiled binary files
instead of importing from TTX, and set lazy=True so we exercise the special SFNTReader.__deepcopy__
2019-01-03 11:26:53 +00:00
Cosimo Lupo
b3e8f76b64
designspace_test: compare normalized paths
https://github.com/fonttools/fonttools/issues/1259#issuecomment-450910787
2019-01-02 16:33:03 +00:00
Cosimo Lupo
a0e4c04c1e
designspace_test: use tmpdir fixture and platform-independent path separator 2019-01-02 15:34:40 +00:00
Cosimo Lupo
3558d4e537
Merge remote-tracking branch 'origin/master' into varlib-build-accept-ds-object 2019-01-02 14:12:56 +00:00
Cosimo Lupo
88eacd3804
designspace_test: test getSourcePath method prefers 'path' attribute when present 2019-01-02 14:10:22 +00:00
Cosimo Lupo
1470ef7258
designspaceLib: add getSourcePath method
and remove BaseDocReader.getSourcePaths as it was broken anyway (it was assuming 'sources'
attribute of DesignSpaceDocument object was a dict, whereas it is now a list of
SourceDescriptor objects
2019-01-02 14:06:55 +00:00
Cosimo Lupo
5b250db6cb
varLib_test: test loading master with layerName but without required font object 2019-01-02 13:39:39 +00:00
Cosimo Lupo
ba197cb84c
varLib_test: no need to reload master_ttfs; reuse the reload_font helper func in the other tests 2019-01-02 12:52:57 +00:00
Just van Rossum
327b05d8c0
[designspaceLib] [t1Lib] [misc.macRes] fix some cases where pathlib.Path objects were not accepted (#1421)
* fix two cases where pathlib.Path objects were not accepted

* make macRes reader accept os.PathLike objects

* use __fspath__ explicitly to support os.PathLike paths

* use __fspath__ explicitly to support os.PathLike paths

* convert tmpdir to str

* only test pathlib.Path on Python 3.6 and up
2018-12-30 12:07:05 +01:00
Nikolaus Waxweiler
e464e450ac Make build and load_designspace accept a DS object 2018-12-19 13:40:11 +00:00
Denis Moyogo Jacquerye
f998688c00
Merge pull request #1413 from moyogo/STAT-1.1
Pin STAT to version 1.1
2018-12-17 20:30:32 +00:00
Behdad Esfahbod
9c3dde3ce6 [varLib] Always write tuple entries for composite glyphs (#1383)
* [varLib] Always write tuple entries for composite glyphs

Fixes https://github.com/fonttools/fonttools/issues/1381
Fixes https://github.com/googlei18n/fontmake/issues/481 partially

* Make sure at least one gvar delta is written for composites

* Add test data for composite fix

* Put in the correct issue link

* Typo

* Fix typos

* Expand comment, add link to issue

* Add ttx files for test font
2018-12-17 14:03:40 +01:00
Denis Moyogo Jacquerye
c48a7b94c1 [varLib] downgrade STAT to version=0x00010001 in tests 2018-12-17 10:31:35 +00:00
Nikolaus Waxweiler
3b2bfcf29a Treat Mapping objects as dicts 2018-12-13 15:44:25 +00:00