1672 Commits

Author SHA1 Message Date
Jens Kutilek
7f8f711dda Remove workaround (#1381) 2025-02-03 12:21:21 +00:00
Colin Rofls
d6f3c51895 [varLib] "Fix" cython iup issue?
In some cases we were seeing different output from iup depending on
whether or not we were running cython code.

I've tracked this particular issue down to the line that is changed in
this diff, and the change introduced in this diff does (locally, for me,
on one machine with one architecture and one compiler) seem to suppress
the problem.

However... it feels pretty bad??

I'm not sure how motivated I am to try and generate a proper minimal
test case and try to get this fixed upstream. I guess I'm.. medium
motivated? But at the very least it would be nice to figure out a more
robust way to prevent this optimization from happening, and at the very
_very_ least it would be nice to figure out away to test this.

The solution I was hoping for was some way to write some actual
hand-written C so we could have finer-grained control over what's going
on, and use that just for this one little bit of arithmetic, but I
didn't see an easy way to do that.
2024-11-27 23:07:39 -07:00
Behdad Esfahbod
e037cea726 [cython] Simplify COMPILED variables 2024-11-27 22:53:16 -07:00
Cosimo Lupo
d2ce6e075c check for mac names in buildVFStatTable for DSv5 sources with STAT data 2024-11-14 12:57:44 +01:00
rsheeter
991e7914e3 Lets not add inconsistent names? 2024-11-13 16:17:56 -08:00
Behdad Esfahbod
b5373bf5d2 [varLib.interpolatable] Support CFF2 input font
Fixes https://github.com/fonttools/fonttools/issues/3666
2024-11-04 11:13:42 -07:00
Behdad Esfahbod
885d7c1ecb [varLib.interpolatable] Warn if only one master was found
Motivated by https://github.com/fonttools/fonttools/issues/3666
2024-11-04 11:13:42 -07:00
Behdad Esfahbod
0c38f86da9 [MultiVarStore] Remove unused optimize parameter 2024-09-25 09:30:39 -06:00
Simon Cozens
ae96a6d374 Fix cut-and-paste error 2024-09-25 06:34:31 -06: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
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
Nathan Williis
7d93689aca Docs: workaround doctest-vs-Sphinx syntax highlighting. 2024-09-11 15:45:46 +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
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
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
Behdad Esfahbod
45bd0637bd [varLib.interpolatable]
Fix master name formatting.

https://github.com/fonttools/fonttools/pull/3599#issuecomment-2269372640
2024-08-05 09:44:59 -06:00
Behdad Esfahbod
f916971913 [instancer] Fix output filename decision-making
All limits are tuples now when not None. The old logic was
broken and for the following command:

$ fonttools varLib.instancer  AdobeVFPrototype.otf CNTR=50:80 wght=900

it was saving the output with the name suffix `-instance`, whereas
it's clearly a partial instantiation. This fixes that.
2024-05-30 11:48:12 -06:00
Simon Cozens
a5a1573012 Revert "[instancer] Fix name decision-making"
This reverts commit 969d09dcafd3669753e30060ccca7e5fd4c356cd.
2024-05-30 14:36:45 +01:00
Khaled Hosny
eff90154ed [varLib.cff] Restore and deprecate convertCFFtoCFF2
It is used by ufo2ft.
2024-05-27 13:18:04 -07:00
Behdad Esfahbod
6c93fc6289 [instancer] Remove not about CFF2 not being supported 2024-05-27 14:16:57 -06:00
Behdad Esfahbod
c2cf6e6d04 [interpolatable] Avoid division-by-zero
Fixes https://github.com/fonttools/fonttools/issues/3533
2024-05-27 10:22:29 -06:00
Peter Dekkers
a531041f3e Ensure that scipy/numpy output is JSON-serializable 2024-05-24 14:57:40 -07:00
Behdad Esfahbod
a1641d91b2 Newer black 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
9f66edb0d1 [varLib.models] Add validate=False to normalizeLocation 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
e88e47f8ff [VARC] Take a stab at instancing 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
902b2a194e [VARC] Fix scaleUpem
Instancing left.
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
a7ca67ada8 [VARC] Update subsetting 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
42a5fbdfdd [VARC] Redesign table
No spec yet. For results see:

https://github.com/harfbuzz/boring-expansion-spec/issues/103#issuecomment-1863533305
2024-05-22 18:46:06 -06:00
Behdad Esfahbod
c91984ef77 [VARC] Use sparse-regions in MultiVarStore
Might revert as the savings are small.
https://github.com/harfbuzz/boring-expansion-spec/issues/103#issuecomment-1861531669
2024-05-22 18:46:06 -06:00
Behdad Esfahbod
a958c68d79 [VARC] Simplify TupleValues
Move it to a converter instead of a class.
2024-05-22 18:46:06 -06:00
Behdad Esfahbod
45f7f4f70f Try fixing Python < 3.12 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
2b09b0da8a Black 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
0f0148e54a [VARC/scaleUpem] Implement 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
2ca627dc5b [VARC/instancer] Fix 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
57dd288d1b [VARC/instancer] Comment 2024-05-22 18:46:06 -06:00