180 Commits

Author SHA1 Message Date
Cosimo Lupo
d9144d4dfc
C_O_L_R_test: add tests for COLRv1 decompile/compile/fromXML/toXML 2020-03-11 19:01:26 +00:00
Cosimo Lupo
d659e055b2
Merge remote-tracking branch 'origin/master' into otdata-colr 2020-03-02 10:59:55 +00:00
Cosimo Lupo
0d53cfbb99
woff2_test: add test with CBDT/CBLC font without glyf/loca tables 2020-02-26 18:24:53 +00:00
Cosimo Lupo
f60bcc2c5a
[CPAL] the absence of a color palette label nameID is 0xFFFF, not 0 2020-02-17 17:03:37 +00:00
Cosimo Lupo
183792c747
_g_l_y_f_test: add tests for Glyph.getCoordinates and GlyphComponent.to/fromXML 2020-02-13 18:08:38 +00:00
Cosimo Lupo
92e770ea16
_g_l_y_f_test: add tests for compiling/decompiling empty glyf table 2020-02-12 14:25:25 +00:00
Cosimo Lupo
423274e444
C_O_L_R_test: use ttLib class's decompile/compile methods 2020-02-10 13:47:20 +00:00
Cosimo Lupo
d4a5e1bf3e
Add C_O_L_R_test.py to check basic compile/decompile of otTables.COLR 2020-02-04 17:15:39 +00:00
Cosimo Lupo
8e2e7d98fc
add C_B_L_C_test.py to test we compile index table format 3 correctly 2020-02-03 14:07:25 +00:00
Cosimo Lupo
58cbf7b814
otTables_test: get XML dumps for expected MarkBasePos split subtables
This tests will fail because of this bug: https://github.com/googlefonts/noto-source/issues/145

The mark records' Class values of the second subtable should be updated to match the new class count
(the two split subtable contain half of the original mark classes). Otherwise the base records would
implicitly reference the wrong or non-existent mark classes...
The fix is in the following commit.
2020-01-07 12:57:20 +00:00
Just van Rossum
cf0e43d6e5
[ttLib.glyf] make glyph.draw() skip redundant final lineTo() (#1775)
* [ttLib.glyf] make glyph.draw() skip redundant final lineTo()

This ensures that g.draw(pen) and g.drawPoints(PointToSegmentPen(pen)) are now 100% equivalent.
2019-12-12 13:44:10 +01:00
Just van Rossum
e2c60e3dcb
[ttLib.glyf] Fix flag bug in glyph.drawPoints() (#1774)
This was the same problem as glyph.draw() had, as reported in #1771.
2019-12-08 21:55:30 +01:00
Just van Rossum
46a06cabf2
[ttLib.glyf] Make sure to use the flagOnCurve mask in glyph.draw() (#1772)
* When drawing glyf outlines to a pen, make sure to use the flagOnCurve mask, so we don't trip over the overlap flag, that is set when instantiating variable fonts to indicate that overlaps are ok.

Fixes #1771.
2019-12-06 10:27:31 +01:00
Nikolaus Waxweiler
e4f7495f32 [name] Be less cautious about getting data for NameRecord comparisons 2019-10-11 17:39:56 +01:00
Nikolaus Waxweiler
2e82438d93 [name] Handle duplicate name records with different string types 2019-10-11 14:24:03 +01:00
Cosimo Lupo
2eeba71d5f
fix cvar, gvar and instancer tests to compare floats as almost-equality 2019-10-08 13:40:07 +01:00
Cosimo Lupo
c60512de0e
_g_l_y_f: use floatToFixedToStr and strToFixedToFloat in GlyphComponent toXML/fromXML 2019-10-08 13:40:06 +01:00
Cosimo Lupo
8791caf3b8
_a_v_a_r: use floatToFixedToStr and strToFixedToFloat in toXML/fromXML methods 2019-10-08 13:40:05 +01:00
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