820 Commits

Author SHA1 Message Date
Marc Foley
336e7827e7 Implement Cosimo feedback 2021-02-26 10:19:43 +00:00
Marc Foley
daf6427b0b Implement Adobe ps naming for instantiated instances 2021-02-26 10:19:43 +00:00
Marc Foley
de38c9ce96 Tidy up variable name and run through black 2021-02-26 10:19:43 +00:00
Marc Foley
5eac886e5a Only create typographic subfamily name if there are nonRibbi tokens 2021-02-26 10:19:43 +00:00
Marc Foley
29e4ff987c instancer: implement Cosimo feedback 2021-02-26 10:19:43 +00:00
Marc Foley
bef1d08c0b instancer: updateNameTableStyleRecords use strings as input instead of axis values 2021-02-26 10:19:43 +00:00
Marc Foley
11f0ade44c cleanup _updateUniqueIdNameRecord 2021-02-26 10:19:43 +00:00
Marc Foley
0bcbbfdbb5 instancer: reuse existing instantiateSTAT func 2021-02-26 10:19:43 +00:00
Marc Foley
9a72311d19 instancer: refactor updateNameTable 2021-02-26 10:19:43 +00:00
Marc Foley
b328475072 wip instancer: update uniqueID 2021-02-26 10:19:43 +00:00
Marc Foley
ce1d8a9955 instancer: Add axisDefaults to axisLimits 2021-02-26 10:19:43 +00:00
Marc Foley
69c8667982 instancer: sort axisValues so format 4 are dominant for constructing names 2021-02-26 10:19:43 +00:00
Marc Foley
0b639c2979 instancer: use bit mask for axisValue flags 2021-02-26 10:19:43 +00:00
Marc Foley
b4b1ce3579 instancer: include attribute axisValues 2021-02-26 10:19:42 +00:00
Marc Foley
f89c01d2d7 instancer: only updateNames if axisValue with specified coord exists 2021-02-26 10:19:42 +00:00
Marc Foley
2fd934051b Refactor axisValuesFromAxisLimits 2021-02-26 10:19:42 +00:00
Marc Foley
4cd0fb80f6 Fix typos 2021-02-26 10:19:42 +00:00
Marc Foley
b502471a08 wip instancer: support format 4 axisvalues 2021-02-26 10:19:42 +00:00
Marc Foley
b95607513c WIP instancer: update static font nametable 2021-02-26 10:19:42 +00:00
Nikolaus Waxweiler
6023bab627 Raise legible error message when script is missing a dflt langsys 2021-01-19 16:42:40 +00:00
Cosimo Lupo
1f33249d36
varLib.cff: fix unbound local variable
Fixes https://github.com/fonttools/fonttools/issues/1787

Thanks Behdad.
2020-12-14 18:21:04 +00:00
Cosimo Lupo
0957dc7ab3
mutator: fix missing tab in interpolate_cff2_metrics
Originally reported in https://twitter.com/ken_lunde/status/1335987620002709507?s=20
2020-12-07 17:16:21 +00:00
Simon Cozens
72291031ac Tidy up add_problem 2020-11-21 08:00:07 +00:00
Simon Cozens
c6e5a7ab93 Catch open contours more explicitly 2020-11-21 07:59:39 +00:00
Simon Cozens
584555a344 fix tests 2020-11-20 11:18:54 +00:00
Simon Cozens
392149ac1d Tidy up output, add machine readable JSON option
Example text output:

```
Glyph D was not compatible:
    Node 1 incompatible in path 0: curveTo in Coolangatta-Regular, lineTo in Coolangatta-Bold
    Node count differs in path 1: 7 in Coolangatta-Regular, 6 in Coolangatta-Bold
Glyph N was not compatible:
    Node 11 incompatible in path 0: curveTo in Coolangatta-Regular, lineTo in Coolangatta-Bold
Glyph v was not compatible:
    Node 7 incompatible in path 0: lineTo in Coolangatta-Regular, curveTo in Coolangatta-Bold
```

Example JSON output:

```
{
  "D": [
    {
      "type": "node_incompatibility",
      "path": 0,
      "node": 1,
      "master_1": "Coolangatta-Regular",
      "master_2": "Coolangatta-Bold",
      "value_1": "curveTo",
      "value_2": "lineTo"
    },
    {
      "type": "node_count",
      "path": 1,
      "master_1": "Coolangatta-Regular",
      "master_2": "Coolangatta-Bold",
      "value_1": 7,
      "value_2": 6
    }
  ],
  "N": [
    {
      "type": "node_incompatibility",
      "path": 0,
      "node": 9,
      "master_1": "Coolangatta-Regular",
      "master_2": "Coolangatta-Bold",
      "value_1": "curveTo",
      "value_2": "lineTo"
    }
  ],
  "v": [
    {
      "type": "node_incompatibility",
      "path": 0,
      "node": 7,
      "master_1": "Coolangatta-Regular",
      "master_2": "Coolangatta-Bold",
      "value_1": "lineTo",
      "value_2": "curveTo"
    }
  ]
}
```
2020-11-20 11:18:54 +00:00
Simon Cozens
08e2a6cdc1 Reformat with black 2020-11-20 11:18:54 +00:00
Simon Cozens
129e2413a0 Gracefully handle glyphset mismatches 2020-11-20 11:18:53 +00:00
Simon Cozens
fdbe0763df Catch explosion on open paths 2020-11-20 11:18:53 +00:00
Simon Cozens
61814d41f5 Allow UFO files to be used in varLib.interpolatable
The joys of well-defined interfaces.
2020-11-20 11:18:53 +00:00
Just van Rossum
0ae6951b3b
Merge pull request #2082 from justvanrossum/gvar-ignore-empty-glyphs
[varLib] Interpret empty non-default glyphs as 'missing'
2020-11-02 18:19:09 +01:00
justvanrossum
16e058fe97 Test for 0xFFFF, not 0xFFF, fixes #2073 2020-10-09 09:33:47 +02:00
Just van Rossum
b992e28374
[varLib] Add designspace lib key for custom feavar feature tag (#2080)
* Add designspace lib key to specify a custom feature tag for feature variations, as discussed in #2079

* Added comment for the lib key

* if the lib key is present, the 'processing' flag should be ignored completely
2020-10-08 14:21:42 +02:00
justvanrossum
3ea29197fc Interpret empty non-default glyphs as 'missing', if the default glyph is not empty. Part of discussion over at googlefonts/ufo2ft/issues/408 2020-10-08 12:06:35 +02:00
Cosimo Lupo
e78d7cf50a
backport fix to varLib.mutator as well 2020-10-05 18:17:14 +01:00
Cosimo Lupo
5ef018e485
[instancer] FeatureVariations table is optional and can be None 2020-10-05 17:50:24 +01:00
Cosimo Lupo
d9d216f8f8
minor: rename OverlapsMode enum -> OverlapMode 2020-09-29 19:33:26 +01:00
Cosimo Lupo
85947cabb3
varLib.instancer: make 'overlap' an enum; add --remove-overlaps CLI option
'overlap' parameter in instantiateVariableFont was a bool, now it is a tri-state IntEnum, with value 2 meaning 'remove the overlaps'. The old bool False/True (0/1) values continue to work like before.

Also added a new --remove-overlaps commandline option to fonttools varLib.instancer script.
2020-09-27 17:48:52 +01:00
Simon Cozens
a2e3e9dce2
Apply suggestions from code review
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2020-09-09 15:28:20 +01:00
Simon Cozens
bc9c7b6b14 [varLib] Test for interpolatability of paths
* Checks node count of each path
* Checks operation type of each path node
2020-09-03 11:24:58 +01:00
Cosimo Lupo
81d0042a9e
varLib.models: fix argument name in main() 2020-08-12 09:41:46 +01:00
Just van Rossum
90c7c7fae1
Fix for #1985: ensure that the AxisNameID in the STAT table is > 255 (#1986)
Fix for #1985:
* ensure that the AxisNameID in the STAT table is not less than 256. This needed an additional argument to the addMultiLingualName() name table method.
* fvar axis name IDs must also not be less than 256, just like STAT axis names.
2020-06-08 19:39:28 +02:00
Nikolaus Waxweiler
45a8fcefc2
[varLib] Allow feature variations to be active across the entire space (#1957)
* Allow feature variations to be active across the entire space

* Add test with empty condition set

* Skip initial box instead of removing it

* Correct comment
2020-05-15 09:27:15 -07: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
Cosimo Lupo
8853d56567
Merge pull request #1930 from simoncozens/python3-inheritance
Use Python3 inheritance style for super.___init__
2020-05-11 11:14:31 +01:00
Cosimo Lupo
07e3cf7ef6
Merge pull request #1928 from simoncozens/unused-loop-variable
Use _ to denoted unused loop variable
2020-05-11 11:10:57 +01:00
Just van Rossum
d6bb38c7e6
[otlLib.builder] Add function to build STAT table from high-level description (#1926)
* added a function to build a STAT table: `fontTools.otlLib.builder.buildStatTable()`
* make `varLib._add_stat()` a client of `buildStatTable()`
2020-05-09 16:08:11 +02:00
Simon Cozens
eda4a2717e Use Python3 inheritance style for super.___init__
Avoids cases where super() argument is not enclosing class: https://help.semmle.com/wiki/display/PYTHON/First+argument+to+super%28%29+is+not+enclosing+class
2020-05-07 21:09:20 +01:00
Simon Cozens
46c8f90da8 Use _ to denoted unused loop variable 2020-05-07 21:00:28 +01:00