9054 Commits

Author SHA1 Message Date
Cosimo Lupo
bd2705a412
Merge pull request #2366 from fonttools/fix-tt-point-pen-move
[TTGlyphPen] Fix NotImplementedError with open contours
2021-07-15 18:39:07 +01:00
Cosimo Lupo
934349a9c5 ttGlyphPen: handle open contours starting with 'move'; treat them as if they were closed
Fixes #2365
2021-07-15 18:25:19 +01:00
Cosimo Lupo
0dc2a2a13f ttGlyphPen: test that open contours work with TTGlyphPen
currently this fails with NotImplementedError. Fix will follow in subsequent commit
2021-07-15 18:19:46 +01:00
Cosimo Lupo
aae11e45c2 Bump version: 4.25.0 → 4.25.1.dev0 2021-07-05 18:10:22 +01:00
Cosimo Lupo
696b7ac448 Release 4.25.0 2021-07-05 18:10:21 +01:00
Cosimo Lupo
4602a9e7ed
Merge pull request #2326 from daltonmaag/compact-gpos
Add GPOS compaction code in varLib.merger and otlLib.builder + new `fonttools otlLib.optimize` command
2021-07-05 18:09:23 +01:00
Jany Belluz
731845c1b8 Update NEWS.rst 2021-07-05 17:34:12 +01:00
Jany Belluz
2ff3159a5f Mark the environment variable as experimental 2021-07-05 17:28:44 +01:00
Jany Belluz
527179619b Refactor the Cluster class to be top-level instead of nested the function 2021-07-05 17:28:44 +01:00
Jany Belluz
016aa4cccc Add docstring to snippet 2021-07-05 17:28:44 +01:00
Jany Belluz
d1c46f9d10 Clarify comment with the plan vs the actual implementation 2021-07-05 17:28:44 +01:00
Jany Belluz
7860dd5fe8 Add tests that optimize block matrices 2021-07-05 17:28:44 +01:00
Jany Belluz
ef67839fdb Fix typing error 2021-07-05 17:28:44 +01:00
Jany Belluz
3b34b228dd Fix fonttools otlLib.optimize command line 2021-07-05 17:28:43 +01:00
Jany Belluz
604513a38f Fix a few comments 2021-07-05 17:28:43 +01:00
Jany Belluz
bba5e8b213 Add optional compaction of GPOS PairPos subtables in otlLib.optimize.gpos
See pull request: https://github.com/fonttools/fonttools/pull/2326

The new module `otlLib.optimize.gpos` provides `compact` functions that
can reduce the file size of GPOS PairPos lookups by splitting subtables
in a smart way to avoid storing zero-valued pairs.

The compaction methods are called from `otlLib.builder` and
`varLib.merger` so that static and variable fonts can benefit from the
optimization at compile time.

The new module `otlLib.optimize` is also executable, to allow running
the optimization on existing fonts.

The optimization is a trade-off because on the one hand it can reduce
significantly the byte size of the GPOS table (up to 50% in random
Google Fonts) but on the other hand it adds to the compilation time and
may make fonts very slightly bigger once compressed to WOFF2 (because
WOFF2 doesn't mind about zero values and compresses them very well).

As such, the optimization is off by default, and you can activate it by
providing the environment variable `FONTTOOLS_GPOS_COMPACT_MODE=5` for
example (values from 0 = off to 9 = max file size savings, but many more
subtables).
2021-07-05 17:28:43 +01:00
Cosimo Lupo
19fe936beb Update changelog [skip ci] 2021-07-05 16:00:31 +01:00
Khaled Hosny
47b45c0db7
Merge pull request #2355 from fonttools/tfmLib-docs
[Doc] Add tfmLib
2021-07-05 16:24:51 +02:00
Khaled Hosny
83ed0b4feb [Doc] Add tfmLib 2021-07-05 16:09:15 +02:00
Khaled Hosny
8d3852385e
Merge pull request #2354 from fonttools/tfmLib
[tfmLib] New library for reading TFM files
2021-07-05 16:03:41 +02:00
Khaled Hosny
a7ac2de5cd [tfmLib] New library for reading TFM files
New library for reading TeX Font Metrics files. Does not support writing
them back.

Fixes https://github.com/fonttools/fonttools/issues/2352
2021-07-05 03:24:25 +02:00
Khaled Hosny
383e70fc39 [sstruct] Accept pad byte format character
The list of format characters that sstruct accepts was missing “x” for
ignored pad bytes.
2021-07-05 01:33:16 +02:00
Khaled Hosny
bdd462f066 [sstruct] Accept bool format character
The list of format characters that sstruct accepts was missing “x” for
ignored pad booleans.
2021-07-03 13:50:08 +02:00
Khaled Hosny
617aee7f03 [sstruct] Minor
To reduce the noise in the next commits.
2021-07-03 13:49:53 +02:00
Cosimo Lupo
6f76bc367b
Merge pull request #2353 from fonttools/sort-gvar-tuples
TupleVariation: make shared tuples order deterministic
2021-07-02 15:36:13 +01:00
Cosimo Lupo
a0bd872f0e TupleVariation: make shared tuples order deterministic
most frequent first (like before https://github.com/fonttools/fonttools/pull/2351), only sort ties alphabetically
2021-07-02 12:52:54 +01:00
Cosimo Lupo
f8b232a23b
Merge pull request #2351 from googlefonts/shared-tuple-order
sort shared tuples produced by Counter.most_common()
2021-07-02 12:07:06 +01:00
Garret Rieger
7f9e2c3808 sort shared tuples produced by Counter.most_common()
In python 3.7 and earlier most_common() sorts first by the item count and then arbitrarily in the event of ties. This can result in two identical instancing operations producing different binary results.
2021-06-30 17:00:59 -07:00
Cosimo Lupo
c8473264eb
Merge pull request #2348 from fonttools/paint-scale-variants
Add PaintScale* and Paint{Rotate,Skew}* variants
2021-06-28 20:10:25 +01:00
Cosimo Lupo
d0d59d2f2c Add PaintScale* and Paint{Rotate,Skew}* variants
This updates fonttools to match the latest draft COLRv1 spec at https://github.com/googlefonts/colr-gradients-spec/pull/290

Summary of changes:
- Added 8 new PaintScale* tables: with/without centers, uniform vs non-uniform
- Added *AroundCenter variants to PaintRotate and PaintSkew (default versions no longer have centerX/Y defaulting to origin)
- PaintRotate, PaintSkew and PaintComposite formats re-numbered
2021-06-28 18:38:47 +01:00
Cosimo Lupo
e3630ac3ac
Merge pull request #2346 from fonttools/rename-colr-v1
COLRv1: rename otData structs to remove 'V1' to match updated draft spec
2021-06-28 17:11:07 +01:00
Cosimo Lupo
1cb7e36bbd COLRv1: rename otData structs to remove 'V1' to match updated draft spec
This is a breaking change (but the COLRv1 API was already marked as unstable and subject to change)

The changes in this PR are meant to match the changes from the COLRv1 draft spec at:
https://github.com/googlefonts/colr-gradients-spec/pull/302
2021-06-28 16:13:47 +01:00
Just van Rossum
414c3733aa
Merge pull request #2344 from takaakifuji/newer-gspp-from-fontpens
Use newer version of GuessSmoothPointPen from fontPens
2021-06-25 09:38:11 +02:00
Takaaki Fuji
58d6ccf8ae Fix math.atan2 call
Shouldn't make any difference here, but math.atan2(y, x) should be the
correct order.
2021-06-25 09:47:21 +09:00
Takaaki Fuji
4c22d11aa7 Keep GuessSmoothPointPen in sync with fontPens
Imported 9b7ecb4 from fontPens, which is the version modified to accept
a parameterized tolerance. Recent changes in fontTools such as 2831096,
186e461 and 7d5530e were considered so that the diff will be minimal.
2021-06-25 09:39:58 +09:00
Behdad Esfahbod
f64f0b42f2 Consolidate bit_count / popCount methods
Fixes https://github.com/fonttools/fonttools/issues/2331
2021-06-04 10:15:51 -06:00
Cosimo Lupo
35dae02dea
Merge pull request #2318 from emuller-amazon/main
Fix parsing of post tables version 2.0 (#2314)
2021-06-03 15:40:30 +01:00
Eric Muller
e2d9919524 Address pull request comments 2021-06-01 07:16:53 -07:00
Cosimo Lupo
1df4f1eac1 subset: drop empty features unless 'size' with FeatureParams table
Fixes #2324
2021-05-27 09:33:29 -06:00
Cosimo Lupo
6a97d4cfdd subset_test: check we keep empty 'size' but drop empty 'ssXX' features
https://github.com/fonttools/fonttools/issues/2324
2021-05-27 09:33:29 -06:00
Eric Muller
add77ca3f7 Report error is post table version 2.0 is too small 2021-05-26 11:27:39 -07:00
Eric Muller
bb5d59300c Merge branch 'fonttools:main' into main 2021-05-25 09:46:42 -07:00
Cosimo Lupo
ee2aa264d5 Bump version: 4.24.4 → 4.24.5.dev0 2021-05-25 14:33:29 +01:00
Cosimo Lupo
b3acb8b984 Release 4.24.4 2021-05-25 14:33:29 +01:00
Cosimo Lupo
b59c4f5252 Update changelog [skip ci] 2021-05-25 14:31:57 +01:00
Cosimo Lupo
cf57ee0bbd
Merge pull request #2323 from fonttools/fix-instancer-valuerecord
instancer: Fix AttributeError when ValueRecord has XAdvDevice but no XAdvance
2021-05-25 14:25:45 +01:00
Cosimo Lupo
b8ce99962c [merger] make getattr(valueRecord, *) default to 0 if it has Device tables but corresponding value is not set
Fixes https://github.com/fonttools/fonttools/pull/2323
2021-05-25 12:36:17 +01:00
Cosimo Lupo
dafce3ff46 instancer_test: add test with PairPos ValueRecord with XAdvDevice but no XAdvance
this currently raises AttributeError in MutatorMerger.merge for ValueRecord table, because the latter assumes that whenever one of the Device tables are present the respective non-device values are also present, but they may be omitted (and it should default to 0 when missing)
2021-05-25 12:30:35 +01:00
Behdad Esfahbod
7af43123d4 [otBase] Tiniest cleanup 2021-05-24 14:52:34 -06:00
Cosimo Lupo
96f0169d9d Bump version: 4.24.3 → 4.24.4.dev0 2021-05-20 19:33:34 +01:00