349 Commits

Author SHA1 Message Date
rsheeter
991e7914e3 Lets not add inconsistent names? 2024-11-13 16:17:56 -08:00
n8willis
63611d4474
Merge pull request #3627 from n8willis/docs-cleanup
Docs: clean up various code blocks in docstrings, to enable correct syntax highlighting in HTML / RTD output.
2024-09-16 10:40:05 +01:00
Nathan Williis
23e3ab60f8 Docs: fix code-example blocks in varLib. 2024-09-03 17:53:56 +01:00
Behdad Esfahbod
0127a235af [varLib.avar] Don't require a full .designspace with sources 2024-08-30 08:46:50 -07:00
Behdad Esfahbod
0a7433f847 [cffLib] Add CFF<->CFF2 convertors that work on otFont 2024-05-16 16:29:22 -07:00
Khaled Hosny
cf08265cd5 Black 2024-02-06 15:47:35 +02:00
Behdad Esfahbod
16991a8cd2 [varLib] Remove unused code 2024-01-26 12:20:34 -08:00
Cosimo Lupo
701b06f3c6
[varLib]: do not log when there are no OTL tables to be merged 2024-01-11 12:00:08 +00:00
Cosimo Lupo
82021732ae
[featureVars] expose method to addGSUBFeatureVariations to existing VF
Fixes https://github.com/fonttools/fonttools/issues/3357
2023-12-01 18:54:15 +00:00
Cosimo Lupo
a2f6f2ffed
[featureVars] allow to assign same subst lookup to several feature tags
this can be useful to maximise layout engine compatibility or simply to have same feature variations substitutions be accessible via mutliple feature tags for whatever reason.

Fixes https://github.com/fonttools/fonttools/issues/2050
Fixes https://github.com/fonttools/fonttools/issues/3004
2023-12-01 16:53:31 +00:00
Behdad Esfahbod
74240afc35 Revert "[varLib] Fix comment"
This reverts commit a54e45a6eafe6006b24b654c6933dd15bdbd436d.
2023-09-15 07:53:09 -06:00
Behdad Esfahbod
a54e45a6ea [varLib] Fix comment 2023-09-15 07:40:29 -06:00
Cosimo Lupo
b73969b2ff
ignore lsb, just use 0xFFFF for sparse advance 2023-08-02 15:54:34 +01:00
Cosimo Lupo
48ae9cbf1c
use 0 for sidebearing sparse metrics sentinel
font sources only allow to specify advances, the sidebearings are computed. Makes more sense for the sparse metrics to have 0 for the sidebearings as the glyph that's meant to be 'sparse' is most likely empty with no outlines
2023-08-02 15:12:26 +01:00
Cosimo Lupo
ecfc5eeeb7
varLib: use sentinel to mark glyph metrics as sparse
as discussed in https://github.com/googlefonts/ufo2ft/issues/501
2023-08-02 14:54:47 +01:00
Cosimo Lupo
b3ce0979cb
Merge pull request #3123 from fonttools/avar2-designspace
[designspace] Add avar2 mapping support
2023-06-08 12:58:51 +01:00
Behdad Esfahbod
d601646cf2 [varLib/avar2] Remove warning
https://github.com/fonttools/fonttools/pull/3123#issuecomment-1573199305
2023-06-02 12:51:25 -06:00
Cosimo Lupo
0690703b86
varLib: add --drop-implied-oncurves option
For the test, I used the Tests/varLib/data/Build.designspace as starting point, modified the 'a' glyph so that 1 on-curve point (the first one) becomes impliable for all the masters.
2023-06-02 15:50:32 +01:00
Behdad Esfahbod
ddf16c9130 [designspaceLib/avar2] Apply review comments 2023-06-01 11:54:43 -06:00
Behdad Esfahbod
a99a75e8a6 [varLib/avar2] Use buildDeltaSetIndexMap()
Also change buildDeltaSetIndexMap() to move the identity
optimization there. Update the only other callsite (COLRv2).
2023-05-30 13:30:36 -06:00
Behdad Esfahbod
a08acf41f8 [varLib/avar2] Omit identity VarIdx map 2023-05-30 13:22:12 -06:00
Behdad Esfahbod
d915f08e76 [varLib/avar2] Don't require base master to be specified explicitly
We can deduce it as empty mapping.
2023-05-30 13:13:49 -06:00
Behdad Esfahbod
ff7f49a94c [varLib/avar2] Add compile test 2023-05-30 13:13:49 -06:00
Behdad Esfahbod
246d539e29 [designspaceLib/avar2] Warn if input location missing for an output axis
https://github.com/fonttools/fonttools/pull/3123#issuecomment-1568852694
2023-05-30 12:10:15 -06:00
Behdad Esfahbod
588cbc982d [designspaceLib/avar2] Rename variables 2023-05-30 11:55:48 -06:00
Behdad Esfahbod
ae2305196a [designspaceLib/avar2] Store axis name, not tag, in <dimension> 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
0b57567c14 [designspaceLib/avar2] Add AxisMappingDescriptor 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
be9dacad74 [designspaceLib/avar2] Rename mapping to axisMappings 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
5785fdeec3 [avar2] Emit the difference of input vs output 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
b9e03b165b [avar2] Rewrite loop 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
50fc8218b3 [designspace/varLib] Hack to read avar2 mapping and build avar2 table
This just uses list of list of dictionaries. Should use proper objects.

https://github.com/fonttools/fonttools/issues/3049

https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2-in-designspace.md
2023-05-28 15:14:25 -06:00
Cosimo Lupo
cf4a24182e
[varLib] don't skip buildVFStatTable from DSv5 with 'STAT' info
Fixes https://github.com/fonttools/fonttools/issues/3045
2023-03-16 18:29:22 +00:00
Cosimo Lupo
5955a47f42
[varLib] build_many(DSv5) from main(); add --output-dir & --variable-fonts options
Fixes https://github.com/fonttools/fonttools/issues/2659
2023-03-07 18:13:28 +00:00
Cosimo Lupo
587b0fbf11
[varLib] don't overwrite existing feaLib-built 'STAT' table
Fixes https://github.com/googlefonts/fontmake/issues/985 and https://github.com/googlefonts/ufo2ft/issues/723
2023-03-07 17:26:15 +00:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Behdad Esfahbod
492645239b [varLib / instancer] Remove DSIG table from font
Fixes https://github.com/fonttools/fonttools/issues/1480
2022-10-28 11:42:57 -06:00
Cosimo Lupo
e4b3394a38 [varLib] omit optional COLR.VarIndexMap for identity mapping
Fixes #2800
2022-09-05 17:18:29 +01:00
Nikolaus Waxweiler
489eff6715 [varlib.build_many] Pass on colr_layer_reuse 2022-08-08 14:06:49 +01:00
Cosimo Lupo
e5029801d2 support merging COLR masters with 'sparse' glyphsets or different layer count
There is no longer a requirement that all the masters have exactly the same base color glyphs as the default masters. Similarly, it's no longer required that all masters' LayerLists have the same total count of layers. It is sufficient that, for a base color glyph in the default master, a non-default master may (or may not) contain one with the same name and same effective number of layers (which in turn can be laid out differently in the respective LayerLists).
This provides greater flexibility when working with variable font project with sparse glyph sets.
2022-07-05 00:11:12 +01:00
Cosimo Lupo
c397764720 COLRVariationMerger: implement reuse of VarIndexBase between tables with same varIdxes
When multiple variable tables refer to the same delta-sets they can now share the same VarIndexBase so the resulting DeltaSetIndexMap is a bit smaller.
For simplicity, we only reuse VarIndexBase when variable tables fully share (ie. same, and same number of) varIdxes; potentially we could reuse subsets of varIdxes (e.g. a VarColoStop.Alpha has a +0.5 delta, and later on elsewhere a PaintVarSolid.Alpha has a similar +0.5 delta; the latter could have a VarIndexBase that reuses an existing DeltaSetIndexMap entry for the former), but for now this I think is good enough.
2022-06-27 17:17:32 +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
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
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
Jany Belluz
2ea5dc3496 [varLib] Add support for designspace 5 + STAT generation + tests 2022-04-14 15:05:50 +01:00
Adam Twardoch
54e2072ecc
Add debug logger showing the glyph name for which gvar is built
When building gvar, some situations cause fontmake/varLib to fail, for example if a component has a coordinate that's >32k or <-32k. This adds a debug line that prints each glyph name for which gvar is built, so it’s easier to pinpoint where the faulty glyph is.
2022-03-09 18:09:52 +01:00
Khaled Hosny
232b2ccbc4 Move the rest of py23 module to textTools
Change all imports to use textTools module, except the test_py23.py test
which is kept until we decide to remove the module (if ever).
2021-08-20 01:29:45 +02:00
Behdad Esfahbod
a756bb01ab [glyf] Prefix setCoordinates, getCoordinatesAndControls, getPhantomPoints
Will add old name with old API next.
2021-04-14 14:09:40 -06:00