Cosimo Lupo
f98c860ff2
Start adding Tests/varLib/merger_test.py for COLRVariationMerger
2022-06-24 18:16:28 +01:00
Cosimo Lupo
f02593cf1a
COLRVariationMerger: fix logic in convertSubTablesToVarType
...
Before we were too greedy in the way we converted subtables to VarType. E.g. If a PaintTransform wrapping a PaintRadialGradient contained variations in the Affine2x3, we would incorrectly convert also the gradient's ColorLine (and ColorStops) to VarColorLine, VarColorStop, etc. (even if the gradient was not variable!). Instead we want skip traversing a given subtable including its children when the predicate doesn't match.
2022-06-24 18:14:58 +01:00
Cosimo Lupo
41943bb0e7
otTraverse: add options to skip_root and predicate to filter out entire sub-trees
2022-06-24 18:04:04 +01:00
Cosimo Lupo
a53a235302
varLib.merger: set Paint.Format to int(PaintFormat)
...
for consistency with the way tables are decompiled from binary data
2022-06-24 11:36:58 +01:00
Cosimo Lupo
7ab7940761
varLib: simplify a bit following varStore.py recent changes
...
#2662
2022-06-24 10:20:48 +01:00
Cosimo Lupo
fcd2a67f52
Merge remote-tracking branch 'origin/main' into variable-colr
2022-06-24 10:16:51 +01:00
naveen
19f5965aa0
chore: Included githubactions in the dependabot config
...
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.
Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot
GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-24 01:30:17 +00:00
Garret Rieger
c63b84db7e
Update how table packing falls back to fontTools from harfbuzz.
...
Introduce three compilation modes:
1. Pure python: only uses the existing fonttools packing and overflow resolution.
2. Harfbuzz+python: uses harfbuzz packing and python overflow resolution. Extensions are allowed to be shared.
3. Python fallback: if harfbuzz+python runs out of resolution options, this disables extension sharing and only uses python packing. Once it succeeds control is passed back to the harfbuzz packer to produce the final packing with extension sharing enabled.
2022-06-23 19:39:56 +00:00
Behdad Esfahbod
97958a95e1
Merge pull request #2662 from fonttools/varstore-empty
...
[varLib.varStore] Support NO_VARIATION_INDEX
2022-06-23 12:02:00 -06:00
Behdad Esfahbod
5d70109645
[varStore] Comment
2022-06-23 12:01:20 -06:00
Behdad Esfahbod
e01f643a8e
[varLib.varStore] Support NO_VARIATION_INDEX in optimizer & instancer
...
Fixes https://github.com/fonttools/fonttools/issues/2211
2022-06-23 12:01:20 -06:00
Behdad Esfahbod
cac7241514
[varLib.varStore] Add NO_VARIATION_INDEX
...
Part of https://github.com/fonttools/fonttools/issues/2211
2022-06-23 12:01:20 -06:00
Cosimo Lupo
0e6a4ec581
[otBase] temporarily disable extension sharing during harfbuzz repacking
...
If extension sharing is enabled some fonts may fail to repack due to fontTools repacker getting stuck in a unrecoverable error.
https://github.com/fonttools/fonttools/issues/2661
2022-06-23 16:34:12 +01:00
Simon Cozens
d224e1f73d
[feaLib] show all missing glyphs at once ( #2665 )
2022-06-23 15:04:59 +01:00
Cosimo Lupo
b4d85f23cf
Merge pull request #2663 from turrisxyz/Pinned-Dependencies-GitHub
...
chore: Set permissions for GitHub actions
2022-06-23 11:19:38 +01:00
nathannaveen
83f69028a3
chore: Set permissions for GitHub actions
...
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ )
Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
2022-06-23 00:58:26 +00:00
Behdad Esfahbod
e917c43ca9
[varLib.varStore] Add operator __bool__ and use it
...
Part of https://github.com/fonttools/fonttools/issues/2211#issuecomment-790125437
2022-06-21 14:03:20 -06:00
Cosimo Lupo
9c0bc3814f
varLib: add --no-colr-layer-reuse option to disable rebuilding LayerList
2022-06-21 17:27:12 +01:00
Cosimo Lupo
00959d3132
varLib: build variable COLR table when master fonts contain COLRv1
2022-06-21 17:27:12 +01:00
Cosimo Lupo
e58c43d187
varLib.merger: add a COLRVariationMerger to merge multiple master COLRv1 into a variable COLR
2022-06-21 17:27:12 +01:00
Cosimo Lupo
24941e613f
otTraverse: add module containing methods for traversing trees of otData tables
...
this is adapted from nanoemoji's
d65a627154/src/nanoemoji/util.py (L122-L162)
2022-06-21 17:27:12 +01:00
Cosimo Lupo
fae63959a9
otTables: add class attributes to link Var{Table} <-> {Table}
...
so one can go from Affine2x3 <-> VarAffine2x3 and similar types that have an associated Var{Type}
2022-06-21 17:27:12 +01:00
Cosimo Lupo
ca2f9e0a94
otBase: use OptionalValue.DEFAULT in populateDefaults()
2022-06-21 17:27:12 +01:00
Cosimo Lupo
bc8f1cfac4
varLib.errors: more informative message with unsupported/inconsistent formats
2022-06-21 17:27:12 +01:00
Cosimo Lupo
fa54b0fd62
otTables: add methods to Format enums to query the variable variants
2022-06-21 17:27:12 +01:00
Cosimo Lupo
97bcda9d35
otBase: define method to get variable attrs with associated VarIndexBase + {offset}
2022-06-21 17:27:11 +01:00
Cosimo Lupo
396353e8e3
otConverters: parse 'VarIndexBase + {offset}' from converters' description
2022-06-21 17:27:11 +01:00
Cosimo Lupo
871ee3d527
otData: add 'VarIndexBase + {offset}' to description of all COLR variable fields
2022-06-21 17:27:11 +01:00
Cosimo Lupo
82460bd368
otConverters: define a base class for all fixed-size floats with toInt/fromInt methods
...
this will be useful when computing deltas for COLR table fields that use Fixed or F2Dot14 (ItemVariationStore internally treats fixed-value floats as 16 or 32-bit integers)
2022-06-21 17:27:11 +01:00
Cosimo Lupo
676a66fad3
otTables: make DeltaSetIndexMap TTX dump less verbose by omitting no-op entries
...
though we still emit the empty <Map index=.../> elements; they help identify chunks of delta-set indices, and define the length of the array upon loading from XML
2022-06-21 17:27:11 +01:00
Cosimo Lupo
0cbdc8536b
[otBase/varLib.merger] don't recurse in ensureDecompiled, merger is already working recursively
2022-06-21 17:27:11 +01:00
Cosimo Lupo
c612b2637f
colorLib.unbuilder: ensure unbuildColrV1 flattens nested PaintColrLayers
2022-06-21 17:27:11 +01:00
Cosimo Lupo
fc982c643b
colorLib: add option to disable PaintColrLayers' reuse of layers from LayerList
...
When building COLR masters, layer reuse may lead to different number of layers between masters, becasue some master may reuse specific layers while others may not. Add a flag to disable this optimization; will need to be run again after the VF COLR font has been merged
2022-06-21 17:27:11 +01:00
Behdad Esfahbod
0d7d7d4e11
[varLib.iup] Rewrite force-set conditions & limit DP lookback length
...
This does two things:
Fixes forced-set computation, which was wrong in multiple ways.
Debugged it. Is solid now... Famous last words.
Speeds up DP time by limiting DP lookback length. For Noto Sans,
IUP time drops from 23s down to 9s, with only a slight size increase
in the final font. This basically turns the algorithm from O(n^3) into
O(n).
2022-06-20 17:09:36 -06:00
Jens Kutilek
d0020b2536
Add check for missing glyphs to featureVars ( #2654 )
...
* Add check for missing glyphs to featureVars
2022-06-17 15:24:54 +02:00
Cosimo Lupo
2aafbb5073
Merge pull request #2656 from fonttools/varlib-undefined-exception
...
[varLib.merger/errors] fix undefined exception name
2022-06-17 12:22:49 +01:00
Cosimo Lupo
c34ff0d474
[varLib.merger/errors] fix undefined exception name
...
The exception UnsupportedFormat was defined and then redefined with the same name in varLib.errors, and imported twice from varLib.merger, probably as result of a sweeping find/replace.
Rename it 'InconsistentFormats' as originally intended.
2022-06-17 11:24:56 +01:00
Cosimo Lupo
95c98f990f
Merge pull request #2649 from googlefonts/recalc_timestamps
...
Add flag to mutator/instancer to allow recalc timestamp to be disabled.
2022-06-14 15:24:27 +01:00
Cosimo Lupo
d6b5ce7669
[varLib.instancer] add --no-recalc-timestamp option
...
same as varLib.mutator
2022-06-14 15:16:12 +01:00
Cosimo Lupo
7b3a8d3d2c
[mutator] rename --no-recalc-timestamp, like in pyftsusbet; simplify option parsing
2022-06-14 15:11:47 +01:00
Garret Rieger
b2c00d7883
Add flag to mutator to allow recalc timestamp to be disabled.
2022-06-13 22:03:32 +00:00
Cosimo Lupo
4fff281c7e
varLib_test: fix expected error message
2022-06-13 12:19:38 +01:00
Cosimo Lupo
8d992508a4
varLib.errors: fix confusing error message when FeatureCount is different
...
see https://github.com/googlefonts/fontmake/issues/894
2022-06-13 12:14:25 +01:00
Cosimo Lupo
513b7d9a36
varLib.errors: use getBestFullName to print name of master ttf
2022-06-13 12:08:40 +01:00
Cosimo Lupo
69c131a1c2
Merge pull request #2642 from fonttools/pyup-scheduled-update-2022-06-06
...
Scheduled weekly dependency update for week 23
2022-06-10 16:27:33 +01:00
Cosimo Lupo
3ceabeda7c
Merge pull request #2645 from fonttools/svg_compression
...
Clean up svgDoc compression #2
2022-06-10 15:53:47 +01:00
Jany Belluz
f19aa60e65
Merge pull request #2634 from fonttools/ds-avoid-isinstance
...
[designspaceLib] Check for descriptor types with hasattr()
2022-06-09 17:50:47 +01:00
Jany Belluz
99a2ad010d
Merge pull request #2640 from fonttools/ds-add-to-all
...
[designspaceLib] Add new classes to __all__
2022-06-09 17:50:22 +01:00
Cosimo Lupo
63ce9ea3e8
requirements.txt: scipy 1.8 now requires py38
2022-06-09 17:26:55 +01:00
Cosimo Lupo
119b7732cc
SVG: strip timestamp to make compressed gzip reproducible
...
we tell GzipFile to write the MTIME field to zero so that the compressed output is reproducible and doesn't change depending on when the data is compressed.
2022-06-09 16:29:29 +01:00