362 Commits

Author SHA1 Message Date
Cosimo Lupo
d66c92fbe0
_f_v_a_r: use floatToFixedToStr and strToFixedToFloat in Axis and NamedInstance 2019-10-08 13:40:05 +01:00
Cosimo Lupo
b50c10af7a
TupleVariation_test: test toXML and fromXML with float axis supports 2019-10-08 13:40:05 +01:00
Cosimo Lupo
e9c7a5227a
_n_a_m_e_test: more tests for removeNames 2019-09-11 15:01:46 +02:00
Cosimo Lupo
7dd510b3b8
Merge pull request #1719 from m4rc1e/name-remove
[name] add removeName method to table__n_a_m_e
2019-09-11 14:53:11 +02:00
Marc Foley
4e316cae57 [name] add removeNames method to table__n_a_m_e 2019-09-11 11:56:09 +01:00
Cosimo Lupo
f2915e7480
Merge pull request #1706 from dscorbett/splitMultipleSubst
Fix MultipleSubst subtable overflows
2019-09-11 09:53:13 +02:00
David Corbett
47c671b1e0 Test splitMultipleSubst 2019-09-10 13:17:40 -04:00
Cosimo Lupo
7c2adacec5
_h_h_e_a_test: add tests for hhea.descender, alias of 'descent' 2019-09-10 16:27:22 +02:00
Simon Cozens
6e55f939e3 [ttLib] Add aliases for renamed entries in hhea table
Closes #1714
2019-09-05 12:38:45 +01:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Cosimo Lupo
1726a4a1fc
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-20 15:05:34 +01:00
Cosimo Lupo
84e9ea167a
woff2: allow to recompress woff2 while keeping flavorData
optionally modifying the list of transformed tables
2019-06-19 12:13:14 +01:00
Cosimo Lupo
6f1d25497a
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-18 18:45:47 +01:00
Cosimo Lupo
3f6a381132
woff2_test: add tests for main() console entry point 2019-06-14 18:30:32 +01:00
Cosimo Lupo
11bfc6856d
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-14 11:31:30 +01:00
Cosimo Lupo
18efee2c7b
TupleVariation: rename get{DeltaType,CoordWidth}; do not special-case scalar=0
we still need to branch between the case where coordinates are wrapped in (x, y) tuples or naked floats.
2019-06-14 11:03:38 +01:00
Cosimo Lupo
8bd83f36bd
woff2_test: add tests for transformed hmtx and untransformed glyf+loca 2019-06-13 18:46:46 +01:00
Cosimo Lupo
0162446f4c
woff2: don't normalize glyf+loca if we aren't transforming them
Also, the TTFont.getGlyphOrder() automatically makes up a dummy
glyph order from the maxp.numGlyphs, we simply need to ensure
'maxp' is decompiled before 'glyf'.

When transforming glyf, the glyf.glyphOrder is guaranteed to
be present (as the glyf table has been already decompiled), so
we don't need to deal with it being missing or incorrect
(hence removed spurious tests).
2019-06-12 18:41:13 +01:00
Cosimo Lupo
6b0e350a06
woff2_test: remove test for no longer reserved bits 6-7 2019-06-11 15:23:58 +01:00
Cosimo Lupo
9af92fdb41
woff2_test: fix up flaky tests
some tests were failing when shuffling the order of the tests with
pytest-randomly. That's because calling TTFont.getTableData method
on 'loca' table before having compiled 'glyf' returns an empty b""
string.
2019-06-11 13:22:38 +01:00
Cosimo Lupo
125bd5186a
TupleVariation: rename {check,get}DeltaType; refactor __iadd__ 2019-04-12 17:01:39 +01:00
Cosimo Lupo
dc99925bee
instancer: always calculate inferred deltas upfront to simplify code
and instead of sumDeltas method, use in-place add operator.
2019-04-04 18:05:11 +01:00
Cosimo Lupo
f220d36df1
instancer: merge TupleVariations left with same axes after pinning
The instantiateTupleVariationStore function now groups TupleVariation
tables that have the same axes 'tents', then merges them into a single
TupleVariation by summing their deltas. The rounding to integer happens
after summing the scaled deltas as floats, to reduce off-by-one errors.

To be able to sum gvar TupleVariation, it needs to calculate the inferred
deltas so it now takes two optional lists (origCoords and endPts) that
are passed on to iup_delta function. These only make sense for gvar
type of TupleVariation, of course, and are unused for cvar tuples.

It also run iup_delta_optimize on the gvar deltas that are left after
partial instancing and whose inferred deltas had to be interpolated.
This can be disabled with --no-optimize CLI option.

Also added calcInferredDeltas and optimize methods to TupleVariation
class, which use functions from varLib.iup module, plus tests
that exercise them.
2019-04-04 15:11:23 +01:00
Cosimo Lupo
c6006a7f8c [glyf] remove_hinting should del program from composite glyph
Unlike simple glyphs, which always have 'program' attribute (even when empty, with no instructions)
in composite glyphs, it's the presence of 'program' attribute that determines whether
the optional WE_HAVE_INSTRUCTIONS component flag is set or not.
Thus, the trim method (with remove_hinting=True) should delete the attribute for
composite glyphs.

Fixes https://github.com/fonttools/fonttools/issues/1550
2019-03-21 12:16:54 +00:00
justvanrossum
12ec7f539e improve error message 2019-03-17 15:35:35 +01:00
justvanrossum
ac2413e905 [ttLib/glyf] raise TTLibError with the offending glyph name in the error message when a component (indirectly) references itself 2019-03-17 15:30:20 +01:00
justvanrossum
24b45b6326 fix embedded license URL in name tables of test fonts 2019-03-06 17:20:40 +01:00
justvanrossum
d897a08fc8 more updated issue URLs 2019-03-06 16:52:35 +01:00
justvanrossum
e22453c933 followup to #1531 2019-03-06 16:47:16 +01:00
Cosimo Lupo
71e44a52ee TupleVariation.toXML: sort attrs min/value/max in TTX dump
It's more legible if the peak value is written after the min and before the max value
defining a given region.
2019-03-04 16:41:26 -08:00
justvanrossum
7c319abbec remove some unused variables; test empty cmap for format 4 2019-03-03 11:59:59 +01:00
justvanrossum
d4a2d935c4 [cmap] changed some uses of list(map(...)) to list comprehensions an explicit loops, avoiding possibly large unneeded tmp lists; replaced use of oval() with int(); adding tests to verify all changes are covered 2019-03-03 10:30:05 +01:00
Sascha Brawer
6a7e299c09 Fix “DeprecationWarning: invalid escape sequence” in Python 3.7 2019-01-22 16:36:15 +01: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
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
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
Denis Moyogo Jacquerye
7e3164e8da kern table: add tests for overflowing subtable 2018-11-20 12:41:57 +00:00
justvanrossum
0d06fd23ce fix test failure in addMultilingualName() test by setting mac to None, which makes it behave like before 2018-11-02 12:12:57 +01:00
Sascha Brawer
2011ccf6ec [morx] Clean up compilation of AAT action tables; add more tests 2018-09-24 20:15:54 +02:00
Sascha Brawer
4a1871ff62 [morx] Support AAT action type to insert glyphs 2018-09-24 18:14:01 +02:00
Jens Kutilek
7c8077a63d Add glyf flags bit6 to ttx output (#1316)
* Implement glyf outline flags bit 6 when decompiling/compiling

* Add test data for outline flag bit 6

* Rename flags, use bitwise OR for setting flag bit

* Remove unneeded code
2018-09-14 15:27:32 +02:00
Cosimo Lupo
0df51c58e0
otTables_test: add unit test for splitMarkBasePos 2018-07-19 17:56:35 +01:00
Cosimo Lupo
0337fc92fc
Tests: adjust to use new otRound function 2018-06-14 17:49:37 +01:00
Cosimo Lupo
d9f7a26027
_g_l_y_f_test: test _checkFloat upgrades to double when overflowing short int 2018-06-07 15:40:50 +01:00
Miguel Sousa
efca91e7f1 [_n_a_m_e_test] ensure that struct format string is native str
https://github.com/fonttools/fonttools/pull/1193#issuecomment-367769342
2018-02-23 03:02:06 -08:00
Cosimo Lupo
f62f79eb23
otConverters: don't write XML comment if NameID value is 0 == NULL
Fixes https://github.com/fonttools/fonttools/issues/1151
2018-01-19 13:25:59 +00:00
Jens Kutilek
cb6676f93e Don't share points in cvar by default (fails in Chrome), adjust tests to test both shared and private points in cvar 2017-11-24 19:06:36 +01:00
Cosimo Lupo
f100754ffb
Merge pull request #1093 from silnrsi/graphite
Fix small graphite round trip bugs
2017-11-07 09:53:36 +00:00
Cosimo Lupo
d91faeaf1a
Merge pull request #1091 from readroberts/master
[CFF2] Fixes for writing PrivateDict BlueValues and Subrs to XML.
2017-11-06 10:13:57 +00:00