820 Commits

Author SHA1 Message Date
Behdad Esfahbod
3d578dd1de [varLib.merger] Adjust for removal of Coverage / ClassDef .Format 2021-03-23 11:05:00 -07:00
Behdad Esfahbod
69918d2945 Revert "[varLib.merge] Fix tests"
This reverts commit fb0c60cd2ce68df546ea2887946bc7f97bbb6921.
2021-03-23 11:02:41 -07: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
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
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
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
1abfbb6cc7 Explain merge errors in designer-friendly terms 2021-03-13 22:30:27 +00:00
Cosimo Lupo
882d09ca8e
instancer: log.warn is deprecated 2021-03-11 18:24:23 +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
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
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
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
Behdad Esfahbod
3a9a2bd4b1 [misc.roundTools] Add noRound(), maybeRound(), and roundFunc()
Moving out of CFF code, to be used in VariationModel().

Part of https://github.com/fonttools/fonttools/issues/2213
2021-03-04 09:20:43 -07:00
Behdad Esfahbod
abc1ba07a4 [misc.roundTools] New module; move otRound() here
Code relying on old place (fixedTools.otRound) still works.
2021-03-04 09:20:43 -07:00
Cosimo Lupo
53b13263e9
Merge remote-tracking branch 'origin/main' into mutator-trivial-fixes 2021-03-04 10:49:49 +00:00
Behdad Esfahbod
28fae1d95f [cff] Simplify rounding logic
No semantic change. Just refactoring and simplification in anticipation
of coming changes.
2021-03-03 18:27:06 -07:00
Behdad Esfahbod
ff46e2838f [varLib.plot] Reorder imports to make missing library easier to detect
$ pip install matplotlib
2021-03-03 16:25:35 -07:00
Simon Cozens
4dd83e0d55 Make terminology consistent 2021-03-03 12:57:12 +00:00
Simon Cozens
e9b35d0318 Split off box-splitting/support code to separate function 2021-03-03 10:33:50 +00:00
Simon Cozens
8c8522560a Separate computing delta weights 2021-03-03 10:23:28 +00:00
Behdad Esfahbod
dec5bb554f [varLib.instancer] Grammar 2021-03-01 12:02:06 -07:00
Behdad Esfahbod
a93ced044f [varLib.mutator] Simplify maxp handling 2021-02-28 18:19:24 -07:00
Behdad Esfahbod
23e5d4eb0b [varLib.mutator] Fix typo: maxInstructionDefs -> maxStackElements 2021-02-28 18:16:23 -07:00
justvanrossum
44b7560fe5 move Vector to its own submodule, and rewrite as a tuple subclass 2021-02-27 19:54:53 +01:00
Marc Foley
52fec53d20
Drop nameID 25 if instantiating a static font 2021-02-26 10:32:38 +00:00
Cosimo Lupo
d1a8e1ee76
fall back to 'Regular' when no subFamilyName
assert we have some 'string' instead of silently continuing
2021-02-26 10:32:38 +00:00
Cosimo Lupo
0c92d33bc0
fix sub-string check in update uniqueID 2021-02-26 10:32:38 +00:00
Cosimo Lupo
fcfcb78cc0
make docstring shorter; fix _isRibbi
return True only if a corresponding english record is found and matches R/I/B/BI, else return False.
We don't really care if there are any other unrelated english records, we care about this specific one, whether it's RIBBI or not

minor
2021-02-26 10:32:21 +00:00
Marc Foley
fcc02826b4
Implement Cosimo feedback from previous pr 2021-02-26 10:31:53 +00:00
Cosimo Lupo
2be13d50ac
make instancer into a package dir and move all names-related funcs to submodule
move instancer tests to Tests/varLib/instancer directory

create instancer/__main__.py to make package executable
2021-02-26 10:31:30 +00:00