104 Commits

Author SHA1 Message Date
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Cosimo Lupo
040fdb03a0
Rework assertion per feedback 2022-10-13 19:17:33 +01:00
Cosimo Lupo
3c935f95ca
normalizeLocation: fix ZeroDivisionErrors with extrapolate=True
these happens when v < default and default==lower, or when v > default but default==upper...
2022-10-13 18:39:56 +01:00
Cosimo Lupo
f66ee05f71
Merge pull request #2847 from fonttools/extrapolate-normalize
Allow extrapolation in normalization
2022-10-13 16:25:42 +01:00
Simon Cozens
4d21550052 Allow extrapolation in normalization 2022-10-13 12:34:59 +01:00
Just van Rossum
668b8d094b Fallback should be value, not 0 2022-10-13 12:54:19 +02:00
Just van Rossum
a91e4d3595 An omitted axis in a location implies a value of 0 -- we need to records that value 2022-10-13 12:48:59 +02:00
Just van Rossum
b073fb8f6f Demand axisRanges is given when extrapolate is True 2022-10-13 12:27:46 +02:00
Just van Rossum
e02e9dc295 Drop -1,+1 fallback and require the axisRanges dict to be complete 2022-10-13 09:07:59 +02:00
Just van Rossum
8e527d3b84 adjust doctests and doc strings 2022-10-13 08:54:28 +02:00
Just van Rossum
4ef44bfbd1 formatting 2022-10-13 08:42:37 +02:00
Just van Rossum
053cba3626 use value as default instead of 0 2022-10-12 16:48:13 +02:00
Just van Rossum
115874cb05 Always ssign axisValues attr 2022-10-12 16:41:50 +02:00
Just van Rossum
f368dcb4dd Attempt to fix #2843 by computing the axis ranges for interpolation 2022-10-12 16:29:14 +02:00
Cosimo Lupo
f5933c1cfa Revert "[varLib.models] Generate narrower tents"
This reverts commit 688939394b8cae3b2a0d5747e435cbd828a14531.
2022-08-23 17:20:57 +01:00
Behdad Esfahbod
5284ac3c58 [varLib.models] Update docstring 2022-08-23 09:56:33 -06:00
Behdad Esfahbod
bad70c68ef [varLib] Support extrapolation
Fixes https://github.com/fonttools/fonttools/issues/1252
2022-08-23 09:56:33 -06:00
Behdad Esfahbod
fce82adba2 [varLib] Clean up __all__ 2022-08-22 11:59:04 -06:00
Behdad Esfahbod
129e9cf6a5 [varLib] Fix doc formatting 2022-08-22 07:43:48 -06:00
Behdad Esfahbod
688939394b [varLib.models] Generate narrower tents
Based on https://github.com/fonttools/fonttools/pull/2218
but modify the general solver instead.
2022-08-14 14:00:09 -06:00
Simon Cozens
0f03e6529a
[docs] Fix sphinx warnings (#2453)
* Add default auto doc options

* Ensure all references are unique

* Use anonymous links to avoid duplicate references

* Remove default options, fix wrong module name

* Don’t index repeated class

* Remove repeated classes included through automodule

* Fix warnings

* We don’t use our own static directory

* Correctly format XML in docs

* Fix indentation

* Fix overline

* Bring TOC to top

* Fix definition list

* Offset definition lists and examples

* Fix erroneous markup

* Fix markup

* Already included in automodule

* Fix args markup

* Correct markup for example

* Don’t reindex repeated module

* Correct XML code block markup

* Fix markup errors, change example to doctest

* Correct list markup

* Make ttx docstring both valid RST and valid help output

* Various other boring markup fixes

* Fix example indenting

* Make docstring valid RST and valid help output

* Mock import for reportlab

* It’s ok if manual links don’t appear in toctrees

* Oops typo, I guess doctests are useful
2021-12-02 15:31:49 +00:00
Simon Cozens
b41b062402 We are iterating over supports, not locations, here 2021-05-12 16:13:58 +01:00
Simon Cozens
2aa1a6ddf6 Remove else-after-return 2021-05-12 15:04:41 +01:00
Simon Cozens
5ac809410f Reformat with black 2021-05-12 15:02:59 +01:00
Simon Cozens
1526b9e024 Another unused enumeration 2021-05-12 15:01:18 +01:00
Simon Cozens
f711b65475 Index was never used 2021-05-12 14:57:20 +01:00
Simon Cozens
1c509f931d Avoid unnecessary intermediary variables 2021-05-12 14:56:44 +01:00
Simon Cozens
ab328b5ecc axisPoints is not used outside the sort function 2021-05-12 14:55:14 +01:00
Behdad Esfahbod
96690de9a9 [varLib] Optimize out multiplication by 1 when computing deltas 2021-04-08 09:41:45 -06: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
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
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
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
Cosimo Lupo
81d0042a9e
varLib.models: fix argument name in main() 2020-08-12 09:41:46 +01:00
Simon Cozens
089f24da6b
Ensure all fonttools CLI tools have help documentation (#1948)
Note UI change : `fonttools varLib.models` now takes prefixed options `-d` or `-l` instead of guessing the intended feature from the number of arguments.

We have a number of command line tools which are somewhat opaque. (varLib.models in particular was very confusing.) This ensures that they all use argparse to have a consistent interface, and all have --help documentation which at least details their parameters, and hopefully therefore gives more of a clue about what they do. Those which use logging have had a command-line logging parameter added.
2020-05-12 15:11:30 +01:00
Simon Cozens
2cef07af80
[doc] Add help options to fonttools CLI (#1920)
This adds a `help` verb (and `--help` option) to the `fonttools` command line tool. Submodules will be listed in the help text if they have an importable `main` function with a docstring, and `main`'s docstring will be used as the one-line description for the help text.
2020-05-12 06:31:13 +01:00
Nikolaus Waxweiler
5a53d1d4ad models: Use new exceptions where input is checked 2020-02-13 15:01:52 +00:00
Cosimo Lupo
38a8eb0e34
varLib.models: fix KeyError when no on-axis points while sorting masters
E.g. when trying to model/plot an unusual designspace like: fonttools varLib.plot 0,0 -1,-1 1,-1 -1,1 1,1
2019-08-12 12:59:45 +02:00
Nikolaus Waxweiler
0f3eaca219 models.py: minor lint fix 2019-08-10 22:20:24 +01:00
Nikolaus Waxweiler
68a5ceac6d varLib: Remove py23 imports 2019-08-10 15:39:02 +01:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Behdad Esfahbod
2ac470b96b Ouch, fix indentation
My bad.  Really sorry.
2019-05-25 17:18:35 -04:00
Behdad Esfahbod
0442d9062a Improve allEqual 2019-05-25 16:12:24 -04:00
Cosimo Lupo
2dedea5f8f models: remove unused axisOrder argument from _computeMasterSupports private method
it's no longer used in the body of the method. If needed, it's accessible from self.axisOrder
2019-03-04 16:58:15 -08:00
Cosimo Lupo
f8c7950e48 models: minor: explicitly test for axisOrder is None
389cf7c56a (r32585140)
2019-03-04 16:51:53 -08:00
Cosimo Lupo
05824b8616 VariationModel: assert that locations are unique 2019-03-04 11:42:54 -08:00
Cosimo Lupo
d8152feb21 VariationModels: remove unused lowerBound/upperBound static methods 2019-03-04 11:15:06 -08:00
Cosimo Lupo
389cf7c56a VariationModel: don't use mutable list default value for 'axisOrder' parameter 2019-03-04 10:58:47 -08:00