8751 Commits

Author SHA1 Message Date
Behdad Esfahbod
69918d2945 Revert "[varLib.merge] Fix tests"
This reverts commit fb0c60cd2ce68df546ea2887946bc7f97bbb6921.
2021-03-23 11:02:41 -07:00
Behdad Esfahbod
10fe1c2636 Don't write Format for Coverage, ClassDef, Single/Alternate/LigatureSubst
The format values for those are automatically handled in
postRead/preWrite to choose optimal format.  As such, don't write them
in XML.  Reduces noise.

https://github.com/fonttools/fonttools/pull/2236#issuecomment-804523961
2021-03-23 11:01:53 -07:00
Nikolaus Waxweiler
2089d05126
Merge pull request #2229 from fonttools/varLib-otlLib-noreload
[varLib/otlLib] Allow merging into VariationFont without first saving GPOS PairPos2
2021-03-22 16:42:45 +00:00
Nikolaus Waxweiler
30ade474dd Update test data 2021-03-22 14:45:24 +00:00
Just van Rossum
959937da3c
Merge pull request #2231 from chrissimpkins/py23-dep-warn
[py23] Nit: change py23 deprecation warning from "next release" to "future release"
2021-03-20 17:30:22 +01:00
Chris Simpkins
3e252d8c87
[py23] change deprecation warning from "next release" to "future release" 2021-03-20 11:52:12 -04:00
Behdad Esfahbod
0faf01d5f1 [otlLib] Generate Value1 / Value2 if respective formats are non-zero
Previously otlLib was generating None if the values themselves were
empty even if the value format was non-empty.  This happened to work
for compiling to binary since the compiler handles Value=None.

But this was confusing varLib.merger module (as in when building
variable fonts from such otlLib-built master GSUB/GPOS tables, without
roundtripping to OTF/TTF binary first), because in varLib.merger,
a None means "this master doesn't provide that info; skip it"; whereas
in a PairPos table a None as generated by otlLib simply meant "all
values are zero", which is different from "this master doesn't
provide this value".

This fixes that, such that ufo2ft can build variable-font without
saving masters to binary.

Part of https://github.com/googlefonts/ufo2ft/pull/486
2021-03-19 13:59:27 -06:00
Simon Cozens
0aeb7f4895
Merge pull request #2226 from simoncozens/fix-merger-errors
(Even) better merger errors
2021-03-19 11:28:18 +00:00
Simon Cozens
baf6c5d1e1 Remove pass if we have a docstring 2021-03-19 10:48:58 +00:00
Simon Cozens
5d7c826b0b Make CFF merge errors inherit differently 2021-03-19 10:40:02 +00:00
Simon Cozens
bfe4bad37b Use kwargs and explicit stack 2021-03-19 10:38:15 +00:00
Simon Cozens
23cb8b989b More tests 2021-03-18 21:24:13 +00:00
Simon Cozens
8ba31b0a43 Improve error message 2021-03-18 21:23:40 +00:00
Simon Cozens
956087eb81 super doesn’t magically call its own methods 2021-03-18 21:23:34 +00:00
Simon Cozens
3e0a87a146 Shorten exception names 2021-03-18 20:58:11 +00:00
Simon Cozens
6c547864b6 Use individual exception classes instead of enum 2021-03-18 15:49:49 +00:00
Simon Cozens
02ebcf8077 Redundant computation 2021-03-17 14:59:36 +00:00
Simon Cozens
bfc4ac9524 Compare enums by identity 2021-03-17 14:59:11 +00:00
Simon Cozens
b26728d3cb Specifically catch VarLibMergeError 2021-03-17 11:56:02 +00:00
Simon Cozens
8a6e3087ce Use pytest exception handling 2021-03-17 11:55:51 +00:00
Simon Cozens
539b3cd71d Special case must actually be special-cased 2021-03-17 11:52:50 +00:00
Simon Cozens
939962f858 Check we can actually get a name 2021-03-17 11:52:35 +00:00
Simon Cozens
2687c12c2e
Merge pull request #2225 from simoncozens/otllib-doc-nit
Correct otlLib documentation
2021-03-16 11:25:12 +00:00
Simon Cozens
f2f8a6a42a Fix docstring too 2021-03-15 13:47:44 +00:00
Simon Cozens
0a1aa19c39 Test for better error message 2021-03-15 13:12:11 +00:00
Simon Cozens
1bf3cccead Provide additional information for a common failure 2021-03-15 12:51:02 +00:00
Simon Cozens
46bd7a7e97 Many fixes... 2021-03-15 12:50:47 +00:00
Simon Cozens
5bac84374b Ensure TTF list is correct 2021-03-15 12:50:07 +00:00
Simon Cozens
e2a859d649 Ensure table name is in error message stack 2021-03-15 12:04:36 +00:00
Simon Cozens
7fc2e37e41 Try harder to get a name from file being merged 2021-03-15 12:00:31 +00:00
Simon Cozens
d0101eff1e Correct otlLib documentation 2021-03-15 11:34:36 +00:00
Simon Cozens
4cdf3312a5
Merge pull request #2223 from simoncozens/better-merge-errors
Explain merge errors in designer-friendly terms
2021-03-15 06:27:54 +00:00
Simon Cozens
1abfbb6cc7 Explain merge errors in designer-friendly terms 2021-03-13 22:30:27 +00:00
Behdad Esfahbod
c321fbe3fa [subset] Call VariationStore.subset_varidxes() as method 2021-03-11 14:12:03 -07:00
Cosimo Lupo
882d09ca8e
instancer: log.warn is deprecated 2021-03-11 18:24:23 +00:00
Cosimo Lupo
d80779d71e
py23_test: remove py27 test always skipped now 2021-03-11 18:23:26 +00:00
Cosimo Lupo
d89b3fbea6
Merge pull request #2216 from fonttools/jh-disambiguate-varlib-merge-errors
[varlib] disambiguate cff merge errors
2021-03-11 10:51:38 +00:00
Josh Hadley
50fb04fd57 [varlib] use VarLibCFFHintTypeMergeError for hint merging 2021-03-05 08:50:43 -08:00
Josh Hadley
aafc814088 [varlib] Add VarLibCFFHintTypeMergeError 2021-03-05 08:47:33 -08:00
Behdad Esfahbod
062b7c434e
Merge pull request #2214 from fonttools/varLib-round
[varLib] Move rounding to VariationModel, to avoid error accumulation from multiple deltas
2021-03-04 16:40:40 -07:00
Behdad Esfahbod
8b52b107c1
Merge pull request #2208 from simoncozens/refactor-variationmodel
Refactor VariationModel
2021-03-04 13:44:13 -07:00
Behdad Esfahbod
ed6164a44f [varLib.cff] Round deltas using bankers round as well
See https://github.com/fonttools/fonttools/pull/2214#issuecomment-790742479

Good news: this reverted the one CFF test that needed its expectation to
change when I started this patchset. Bad news: it introduced a couple other
diffs to the same glyph of the same test, which is consistent with changing
the rounding from otRound to round3.
2021-03-04 13:10:01 -07:00
Behdad Esfahbod
d56b844142 [varLib] Round outline deltas using banker's round as well
See https://github.com/fonttools/fonttools/pull/2214#issuecomment-790742479
2021-03-04 13:00:04 -07:00
Just van Rossum
6a8821d91c
Revert "Use Vector in some places where it improves the clarity of the code" (#2215)
* Revert most of "Use Vector in some places where it improves the clarity of the code (#2206)"

This reverts most of commit 0d3ce2cafc6f604fc46d4d3bfbab34a5bc59e27b.
2021-03-04 20:15:24 +01:00
Behdad Esfahbod
07a7dd3eb5 [varLib] Make newly-added round arguments keyword-only
So they are not accidentally set, only intentionally. Keeps positional-args
open for more direct uses.
2021-03-04 09:44:34 -07:00
Behdad Esfahbod
f5ef0b517b [varLib] Round most deltas using bankers' round, not otRound
See https://github.com/fonttools/fonttools/pull/2214#issuecomment-790742479
2021-03-04 09:43:26 -07:00
Behdad Esfahbod
606b072f40 [glyf] Add round=otRound parameter to GlyphCoordinates.toInt() & __round__() 2021-03-04 09:43:08 -07:00
Behdad Esfahbod
68004b8fec [varLib] Shift most (all?) delta-rounding to VarModel
Reduces error.

The main varfont-builder now asks the model to do rounding, and asks
VariationStore to do no rounding, so we don't spend extra times rounding
multiple times (specially with the heavy otRound).

I *think* I got it all and right...

Fixes https://github.com/fonttools/fonttools/issues/2213
2021-03-04 09:20:43 -07:00
Behdad Esfahbod
77acdbced3 [glyf] Remove stale comment about Python 2 2021-03-04 09:20:43 -07:00
Behdad Esfahbod
fdd8267065 [varLib.models] Add optional rounding to VariationModel() relevant methods
Users to be updated to benefit.

Part of https://github.com/fonttools/fonttools/issues/2213
2021-03-04 09:20:43 -07:00