Harry Dalton
07351d12e6
Fix visual artefacts with partial L2 instancing
...
Closes #3634
To produce inferred deltas that will be correct given OpenType's gvar
semantics, fontTool's IUP optimisation module checks the equality of
some points. However, this happens before the points are rounded,
whereas the point comparison that happens at runtime will occur after
the points are rounded (as is necessary to serialise glyf), which leads
to diverging semantics and so diverging and incorrect implied deltas.
This leads to significant visual artefacts, e.g. where large deltas that
should be inferred based on previous values are instead interpreted as 0
at runtime.
I suspect this has gone undetected as the subsetter normally works with
rounded points; in the rarer case that partial VF instancing is
occurring with a different default position, however, varLib.instancer
will calculate and apply the relevant deltas to the font's original
coordinates to effect the new default position, which leads to unrounded
points in memory. This commit ensures that we round directly before
optimising (but still after calculating `glyf` metrics, for backward
compatibility).
2024-09-15 12:10:29 -07:00
ftCLI
9f7025af8f
Merge branch 'fonttools:main' into ttf2otf
2024-09-12 08:51:52 +02:00
Nathan Williis
d05cdcf21f
Docs: black
2024-09-11 15:48:09 +01:00
Nathan Williis
7d93689aca
Docs: workaround doctest-vs-Sphinx syntax highlighting.
2024-09-11 15:45:46 +01:00
Roel Nieskens
11343ed64c
Add instructions to escape question mark
...
Arguments without it will not work in zsh and possibly other shells.
2024-09-10 11:17:33 -06:00
Roel Nieskens
d871fd3a08
Remove dotslash from examples
2024-09-10 11:17:33 -06:00
خالد حسني (Khaled Hosny)
4767465183
Merge pull request #3632 from fonttools/dependabot/github_actions/pypa/gh-action-pypi-publish-1.10.1
...
Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.1
2024-09-09 23:39:59 +03:00
dependabot[bot]
af27eb0aef
Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.1
...
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish ) from 1.9.0 to 1.10.1.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases )
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.9.0...v1.10.1 )
---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 19:43:06 +00:00
Nathan Williis
6914070e00
Docs, minor: remove trailing whitespace.
2024-09-04 17:36:48 +01:00
Nathan Williis
21d04842f8
Docs: fix code-example blocks in ttLib.
2024-09-03 17:55:02 +01:00
Nathan Williis
df49533892
Docs: fix code-example blocks in voltLib.
2024-09-03 17:54:45 +01:00
Nathan Williis
1fc9bc2dca
Docs: fix code-example blocks in varLib/instancer.
2024-09-03 17:54:29 +01:00
Nathan Williis
23e3ab60f8
Docs: fix code-example blocks in varLib.
2024-09-03 17:53:56 +01:00
Nathan Williis
4b9cb1030e
Docs: fix code-example blocks in svgLib.
2024-09-03 17:52:59 +01:00
Nathan Williis
e7c78970ce
Docs: fix code-example blocks in ufoLib.
2024-09-03 17:52:20 +01:00
Nathan Williis
f771c37149
Docs: fix code-example blocks in pens.
2024-09-03 17:52:02 +01:00
n8willis
c2119229cf
Merge pull request #3625 from n8willis/docs-cleanup
...
Docs: fix Sphinx builds.
2024-09-03 11:21:08 +01:00
Nathan Williis
c19b1c5148
Docs: move module docstrings to first line of file, as per PEP 257.
2024-09-02 17:18:41 +01:00
Nathan Williis
cd1c31ff6c
Docs: reorder Sphinx extensions. Napoleon must precede autodoc or it will trigger superfluous warnings about indentation.
2024-09-02 17:13:48 +01:00
Cosimo Lupo
b3520722ec
Merge pull request #3617 from fonttools/visit-param-ui-labels
...
NameRecordVisitor: include whole sequence of character variants' UI labels, not just the first
2024-08-30 18:34:46 +01:00
Cosimo Lupo
afd73dd2b1
NameRecordVisitor: remove unnecessary check for out of bounds nameIDs
2024-08-30 18:20:13 +01:00
Cosimo Lupo
8f01590353
FeatureParamsSize.SubfamilyID is *not* actually a NameID
2024-08-30 18:20:12 +01:00
Cosimo Lupo
821f37329e
NameRecordVisitor: include whole sequence of UI labels for character variants, not just first
...
Fixes #3616
2024-08-30 18:20:12 +01:00
Cosimo Lupo
1938825851
Merge pull request #3622 from fonttools/repro-3616
...
subset_test: add failing test to reproduce issue #3616
2024-08-30 18:19:22 +01:00
Cosimo Lupo
00ad60b4c3
subset_test: add failing test to reproduce issue #3616
...
If we subset this test font (a subset of Google Fonts' Andika-Regular.ttf) and request to keep 'cv43', only the FirstParaUILabelNameID (324) is currently kept, the other two (325 amd 326) get incorectly dropped.
All referenced nameIDs should be kept.
This will be fixed with https://github.com/fonttools/fonttools/pull/3617
```
> assert nameIDs == keepNameIDs
E assert {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324} == {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324, 325, 326}
E Extra items in the right set:
E 325
E 326
E Full diff:
E - {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324, 325, 326}
E ? ----------
E + {0, 1, 2, 3, 4, 5, 6, 321, 322, 323, 324}
```
2024-08-30 18:13:44 +01:00
Behdad Esfahbod
ce534ac74a
Merge pull request #3598 from fonttools/avar2-reconstruct-mappings
...
[varLib.avar] Reconstruct mappings from binary
2024-08-30 11:04:20 -06:00
Behdad Esfahbod
dab890e681
[varLib.avar] Add another test
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
8d58f7f730
[varLib.avar] Add roundtrip test
...
Fails currently.
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
132654c9e5
[varLib.avar] Comment
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
2742c6287c
[varLib.avar] Test & fix _pruneLocations
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
700b6a7b0e
[varLib.avar] Refactor code
...
So we can test it.
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
65ab19468d
[varLib.avar] Comments and a bug fix
...
Code was in wrong block.
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
bd76b4a24b
[varLib.avar] Handle default location mapping somewhere else
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
34e38c3d03
[varLib.avar] Do less work
...
No need to compute outputLocation for unneeded inputLocations.
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
9f19a19c4e
[varLib.avar] Introduce base master earlier
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
b8306b1d82
[varLib.avar] Fix normalization
...
And see if I can make it deterministic. It still isn't.
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
cb031514ea
[varLib.avar] Try dropping unnecessary "masters"
...
Untested, as I don't have a test font that exercises this.
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
e606adfffe
[varLib.avar] Add peakLocation as well, oops
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
0127a235af
[varLib.avar] Don't require a full .designspace with sources
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
297f73aeaf
[varLib.avar] Err, don't drop empty pins
...
https://github.com/fonttools/fonttools/issues/3086#issuecomment-2263626285
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
40f6760e8a
[varLib.avar] Don't clamp values
...
https://github.com/fonttools/fonttools/pull/3598#issuecomment-2266082009
2024-08-30 08:46:50 -07:00
Behdad Esfahbod
150d4fc195
[varLib.avar] Sketch of code to reconstruct mappings from binary
...
https://github.com/Lorp/fencer/issues/25
2024-08-30 08:46:50 -07:00
n8willis
770917d89e
Merge pull request #3611 from n8willis/docs-cleanup
...
Small docs cleanups
2024-08-21 17:34:52 +01:00
Behdad Esfahbod
ecd2d8e559
[Tests] Do not require fonttools command to be available
...
I typically run tests like:
$ python setup.py build_ext -i && PYTHONPATH=Lib pytest
Previously, this particular test and only this, required
that a `pip install -e .` has had happened. Not anymore.
2024-08-20 10:58:55 -06:00
Nathan Williis
1781cf8f75
Docs, minor: reformat line for lint GH action.
2024-08-20 17:00:52 +01:00
Nathan Williis
868f50daf4
Pin the Sphinx dependency to v7; v8 breaks the RTD theme. See issue #3606
2024-08-20 16:15:50 +01:00
Nathan Williis
6f7d949d5c
Docs: update Sphinx config, to show inheritance. This should simplify cross-module readability, and also makes errors caused by autodoc easier to spot.
2024-08-20 16:14:46 +01:00
Nathan Williis
31b5ce1f8e
Docs, minor: fix Sphinx warnings.
2024-08-20 16:12:00 +01:00
Behdad Esfahbod
0c2652011e
[varLib.models] By default, assume OpenType-like normalized space
...
See:
https://github.com/fonttools/fonttools/pull/2846#issuecomment-2267750076
I *think* this is an improvement, and no one should have been relying
on the broken existing behavior.
Docs need updating.
2024-08-16 18:45:08 -06:00
Behdad Esfahbod
ead2a18d4b
[varLib.interpolatable] Support discrete axes in .designspace
...
Fixes https://github.com/fonttools/fonttools/issues/3597
2024-08-16 12:14:30 -06:00