816 Commits

Author SHA1 Message Date
Cosimo Lupo
a0a4901a5e
colorLib_test: add tests for buildCPAL v1 2020-02-17 18:28:24 +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
acfae6721b
add tests for buildCORL and buildCPAL 2020-02-17 12:11:53 +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
d8d824011a
Merge pull request #1830 from anthrotype/scaled-comp-bbox
[ttGlyphPen] quantize component.transform to F2Dot14 to normalize bbox
2020-02-13 15:37:45 +00:00
Nikolaus Waxweiler
5a53d1d4ad models: Use new exceptions where input is checked 2020-02-13 15:01:52 +00:00
Nikolaus Waxweiler
8f7a796bd3 init: Convert existing raised exceptions to new appropriate ones 2020-02-13 14:58:10 +00:00
Nikolaus Waxweiler
5cda8381f9
[feaLib] Check that glyph names referenced in the feature file are part of the glyph set (#1828)
This checks that glyph names that appear in a feature file are actually
in the glyph set provided in glyphNames. If the set is empty, no check
is done. This preempts a KeyError later during saving of a TTFont object
and makes this case much more easily catchable.

Closes #1723.
2020-02-13 14:47:29 +00:00
Cosimo Lupo
b6467b7e85
ttGlyphPen: quantize component.transform to F2Dot14 to fix issue with bbox
Fixes https://github.com/googlefonts/fontmake/issues/558

When drawing a composite glyph with a scaled component using the TTGlyphPen, the bounding
box coordinates may change depending on whether one computes them *before* compiling or
*after* decompiling. Before compiling, component.transform holds double precision floats,
but after compiling and decompiling, these are necessarily clamped to F2Dot14 fixed precision.

The TTGlyphPen needs to quantize transform floats to F2Dot14 so that the values don't
change after compilation.

Without this change, it may happen that round-tripping fonts through ttx (which by default
recalcBBoxes) will produce different bounding boxes for composite glyphs that have
scaled or transformed components.
2020-02-13 13:49:01 +00:00
Cosimo Lupo
e35228603d
Merge pull request #1829 from anthrotype/empty-glyf
[glyf] compile empty table as 1 null byte to make OTS and Windows happy
2020-02-12 14:52:23 +00:00
Cosimo Lupo
cf0567d8a5
subset_test: test subsetting font to empty glyf table 2020-02-12 14:25:25 +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
Nikolaus Waxweiler
eb77a3be22 [varLib] Fill in the forward-mapped location 2020-02-11 15:45:49 +00:00
Nikolaus Waxweiler
ef2742593c Compare realpath against realpath
On Windows, tests may be run in the user's temp directory, so the previous code
may compare C:\Users\nikolaus.waxweiler\ against C:\Users\NIKOLA~1.WAX\.
2020-02-04 11:08:45 +00:00
Cosimo Lupo
1c2fb0e3ef
Merge pull request #1809 from justvanrossum/demo-issue1808
[varLib] demonstrate and fix #1808
2020-02-03 15:39:32 +00:00
Khaled Hosny
b9bc128f2c
Merge pull request #1816 from khaledhosny/varlib-cff2-source
[varLib] Allow using CFF2 table as source
2020-02-03 17:17:02 +02:00
Cosimo Lupo
78abdf2299
Merge pull request #1818 from fonttools/eblc-index-subtable-3
EBLC: fix padding length calculation for Format 3 IndexSubTable
2020-02-03 15:15:24 +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
Khaled Hosny
09174b9129 [CFF2] Make recalcBBoxes work with CFF2 table
Add checks for CFF2 table next to CFF checks as applicable.
2020-01-31 23:39:47 +02:00
Khaled Hosny
38981b6dae [varLib] Allow using CFF2 table as source
Nothing clever, if the source font has a CFF2 table use it as if it were
a CFF table (i.e. non-variable, not sure what would happen in the source
CFF2 was variable already).
2020-01-31 23:39:47 +02:00
Khaled Hosny
014991d710
Merge pull request #1815 from khaledhosny/fealib-flag-fix
[feaLib] Don’t reset lookupflag in nested lookups
2020-01-30 13:06:42 +02:00
Khaled Hosny
42b51f084f
Merge pull request #1814 from khaledhosny/fealib-mult-fix
[feaLib] fix mixed single/multiple substitutions
2020-01-30 13:02:39 +02:00
Khaled Hosny
eed252cb92 [feaLib] Don’t reset lookupflag in nested lookups
In makeotf, lookups defined inside feature blocks inherit the current
lookupflag of the feature, so don’t reset the lookupflag for such
lookups.
2020-01-29 23:46:40 +02:00
Khaled Hosny
22bfc305ee [feaLib] fix mixed single/multiple substitutions
If the single substitution involved a glyph class, we were incorrectly
using only the first glyph in the class.

Broken since ec6ff821f0e72022d7aec8794b6bb589d8f81808, apparently no one
else uses this feature!
2020-01-29 22:36:54 +02:00
justvanrossum
0bb234d218 added test 2020-01-29 12:42:27 +01:00
justvanrossum
92e03c72b2 removed leftovers from previous edit 2020-01-29 12:02:26 +01:00
justvanrossum
69800b0db5 no need to explicitly close: varLib.build() will do that. 2020-01-29 12:01:05 +01:00
justvanrossum
49507a9de8 undo DesignSpaceDocument context manager changes, and explicitly (but opt-out) close master_fonts within varLib.build() 2020-01-29 11:55:39 +01:00
justvanrossum
e18f63cfa3 make DesignSpaceDocument a context manager that closes source fonts, and use it in the varLib tests. 2020-01-29 11:17:57 +01:00
David Corbett
62ed43ddb9 Do not fail on duplicate multiple substitutions 2020-01-26 10:30:17 -05:00
Cosimo Lupo
a32fd30c2d
subset_test: add test for optimizing SinglePos format when all subsetted values are same 2020-01-16 18:30:07 -08: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
Jens Kutilek
720488ed4b Merge branch 'master' into fealib-duplicate-sub-warning 2019-12-18 11:24:00 +01:00
Jens Kutilek
67da54fb5f Add a simple test 2019-12-18 11:09:23 +01:00
Cosimo Lupo
70c3eccb4e
glifLib_test: test xml containing <!-- comment --> 2019-12-16 12:01:40 +00:00
Cosimo Lupo
3b9a94d659
Merge pull request #1782 from anthrotype/subset-feature-vars-remap-indices
[subset] remap FeatureVariations SubstitutionRecord.FeatureIndex
2019-12-12 13:51:59 +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
Cosimo Lupo
9c0c3a1375
subset_test: Add (failing) test to repro #1777
the 'rvrn' feature is being incorrectly dropped because the feature indexes
change if some other feature occuring before 'rvrn' is dropped, like
in this test case.
2019-12-12 12:29:08 +00:00
Cosimo Lupo
e821f1fb9e
fontBuilder: add FontBuilder.addFeatureVariations method
like the existing addOpenTypeFeatures
it simply forwards to featureVars.addFeatureVariations
2019-12-12 11:55:13 +00: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
Cosimo Lupo
ae5212f76b
add tests for RecordingPointPen 2019-11-28 16:32:40 +00:00
Cosimo Lupo
f6e69af7ba
Merge pull request #1763 from anthrotype/ttpen-float-coords
ttGlyphPen must round float coordinates and offsets
2019-11-26 16:31:25 +00:00
Cosimo Lupo
7fe59e4b94
ttGlyphPen_test: test computing bounds with float coordinates and offsets
https://github.com/googlefonts/fontmake/issues/593

This test currently fails. The compositeGlyph.xMax is set to 281, but it should be 282.
2019-11-26 16:03:18 +00:00
Jens Kutilek
6c3edaded2
ufoLib groupnames conversion 2 → 3 (#1762)
* If a group name is the same as a glyph name, it cannot be a kerning group name
* Add test
2019-11-22 09:51:35 +01:00
Cosimo Lupo
12e1a6de37
instancer: catch early if input range doesn't include current default 2019-11-15 19:02:12 +00:00
Cosimo Lupo
7c695d411f
Merge remote-tracking branch 'origin/master' into l3-instancer 2019-11-15 17:05:47 +00:00
Cosimo Lupo
9a707a2c1b
instancer_test: test empty HVAR is not dropped 2019-10-24 17:37:49 +01:00
Cosimo Lupo
10d544d6a4
instancer_test: update tests for instantiateSTAT new behavior
And add tests for limiting STAT's axis ranges.
2019-10-24 17:37:49 +01:00
Cosimo Lupo
b8500ac97c
instancer_test: add tests for restricting axis ranges (L3) 2019-10-24 17:10:32 +01:00