9463 Commits

Author SHA1 Message Date
Behdad Esfahbod
86b5d7103d [interpolatable] Downgrade assert 2022-04-01 14:00:22 -06:00
Behdad Esfahbod
6b4e2e7147 [ufoLib / interpolatable] Wire up outputImpliedClosingLine parameter
ufoLib's glyph draw() was passing outputImpliedClosingLine=False to
PointToSegmentPen(). This was causing incompatible nodes in
interpolatable tool for certain fonts, like this in NotoSansDevanagari:

Glyph dabhadeva was not compatible:
    Node count differs in path 1: 23 in NotoSansDevanagari-Bold, 24 in NotoSansDevanagari-CondensedBold
    Node count differs in path 1: 24 in NotoSansDevanagari-CondensedBold, 23 in NotoSansDevanagari-CondensedLight

Because a final lineto before a closepath was being elided or not in
some masters but not others.  Wire up the parameter and control it
from interpolatable tool to fix this.
2022-04-01 13:14:39 -06:00
Behdad Esfahbod
3165cc132a [interpolatable] Add mirrored rotated contour for starting-point check
This further found an issue in NotoSansArabic which I visually verified:

Glyph qafLamAlefMaksuraabove-ar was not compatible:
    Contour start point differs: NotoSansArabic-CondensedLight, NotoSansArabic-CondensedSemiBold
    Contour start point differs: NotoSansArabic-CondensedLight, NotoSansArabic-CondensedSemiBold
    Contour start point differs: NotoSansArabic-CondensedSemiBold, NotoSansArabic-Condensed
    Contour start point differs: NotoSansArabic-CondensedSemiBold, NotoSansArabic-Condensed
2022-03-31 20:23:54 -06:00
Behdad Esfahbod
9e96b95467 [interpolatable] Don't keep contour-start-point index 2022-03-31 20:18:44 -06:00
Behdad Esfahbod
b705bcdc8f [interpolatable] When checking for contour start point error allow for 5% error 2022-03-31 20:16:55 -06:00
Behdad Esfahbod
745631d16b [interpolatable] In diff-contour-order, allow for 5% cost difference
Reduces false-positives, as in this one in NotoSansArabic:

Glyph asteriskArt-ar was not compatible:
    Contour order differs: [0, 1, 2, 3, 4, 5] in NotoSansArabic-CondensedBold, [0, 3, 2, 1, 4, 5] in NotoSansArabic-CondensedLight
2022-03-31 19:52:48 -06:00
Behdad Esfahbod
3a846a5389 [interpolatable] Remove the empirical high-cost error
This was very empirical and has no theoretical background. Experiment
shows that this is mostly false-positive.
2022-03-31 19:37:00 -06:00
Behdad Esfahbod
d0d8039bd3 [varLib.interpolatable] Check for wrong contour starting point
This seems to work already. Detects the example in the issue.
I also ran this on master-compatible UFOs built from Noto Sans,
and detected several issues. Confirmed visuall in AxisPraxis that
theta.sc for example has wrong starting point in that font:

Glyph theta.sc was not compatible:
    Contour start point differs: NotoSans-DisplayRegular, NotoSans-DisplaySemiBoldCondensed
    Contour start point differs: NotoSans-DisplayRegular, NotoSans-DisplaySemiBoldCondensed
    Contour start point differs: NotoSans-DisplaySemiBoldCondensed, NotoSans-DisplaySemiBold
    Contour start point differs: NotoSans-DisplaySemiBoldCondensed, NotoSans-DisplaySemiBold

There's a TODO item left to be done, which is to check for mirrored
contours and rotations thereof.

Towards fixing https://github.com/fonttools/fonttools/issues/1801
2022-03-31 19:17:22 -06:00
Khaled Hosny
4bb0e776a7
Merge pull request #2570 from fonttools/cff-TopDictIndex
[cffLib] Fix calls to TopDictIndex()
2022-04-01 00:24:17 +02:00
Khaled Hosny
f028c201bd
Merge pull request #2569 from fonttools/cff-globalState
[cff] Remove GlobalState
2022-04-01 00:11:21 +02:00
Behdad Esfahbod
c7781ec423 [cffLib] Remove leftover GlobalState
Fixes https://github.com/fonttools/fonttools/issues/1848
2022-03-31 15:34:11 -06:00
Behdad Esfahbod
64fc028eee [cffLib] Fix calls to TopDictIndex()
Fixes https://github.com/fonttools/fonttools/issues/1847
2022-03-31 15:33:05 -06:00
Just van Rossum
eaafd6089e
Clear AxisValueArray if it is empty after instantiating. (#2563)
* Clear AxisValueArray if it is empty after instantiating. Fixes #2562

* rearrange the code a bit for clarity
2022-03-25 16:42:17 +01:00
Khaled Hosny
a83f07670e Bump version: 4.31.2 → 4.31.3.dev0 2022-03-22 14:57:43 +02:00
Khaled Hosny
5e849a4479 Release 4.31.2 2022-03-22 14:57:32 +02:00
Khaled Hosny
47457b14d6
[varLib] Fix instantiating some SinglePos subtables (#2555) 2022-03-22 08:34:18 +00:00
Cosimo Lupo
0465f81b79 Bump version: 4.31.1 → 4.31.2.dev0 2022-03-18 13:30:10 +00:00
Cosimo Lupo
1a30ee825c Release 4.31.1 2022-03-18 13:30:10 +00:00
Cosimo Lupo
5c9d65cb1a Update changelog 2022-03-18 13:30:04 +00:00
Cosimo Lupo
fcc863a46d
Merge pull request #2553 from fonttools/fix-subset-svg-gid-on-root
[subset] fix subsetting OT-SVG when glyph id attribute is on the root <svg> element
2022-03-18 13:28:11 +00:00
Cosimo Lupo
315705a58f [subset] fix subsetting OT-SVG when glyph id attribute is on the root <svg> element
Fixes https://github.com/fonttools/fonttools/issues/2548
2022-03-18 13:18:53 +00:00
Cosimo Lupo
caa32df25a Bump version: 4.31.0 → 4.31.1.dev0 2022-03-18 11:12:10 +00:00
Cosimo Lupo
422a10b61b Release 4.31.0 2022-03-18 11:12:10 +00:00
Cosimo Lupo
ec227d0b86 Update NEWS.rst 2022-03-18 11:12:03 +00:00
Cosimo Lupo
d7169774ac
Merge pull request #2551 from fonttools/unlazy
add ensureDecompiled method to decompile all the tables irrespective of lazy attribute
2022-03-18 10:55:48 +00:00
Cosimo Lupo
25746a3600 add clarifying comment as per review 2022-03-18 09:23:07 +00:00
Cosimo Lupo
ab8fc321a7 otBase: also return name and index from iterSubTables
makes it more useful for constructing generic traversals of trees of otTables
2022-03-17 17:47:41 +00:00
Cosimo Lupo
6e0cebc487 ttFont_test: add test for ensureDecompiled 2022-03-17 17:13:50 +00:00
Cosimo Lupo
43d2ee2822 Revert "return self so one can do font=TTFont(file).ensureDecompiled()"
This reverts commit 61e7b294483cbe729b1437804406b4571ae57cfb.
2022-03-17 15:55:20 +00:00
Cosimo Lupo
61e7b29448 return self so one can do font=TTFont(file).ensureDecompiled() 2022-03-17 15:44:02 +00:00
Cosimo Lupo
46f33357cb TTFont: don't load all tables upon opening even with lazy=False
one has to call TTFont.ensureDecompiled to load everything
2022-03-17 13:48:40 +00:00
Cosimo Lupo
795bccd966 TTFont: load all on open w/ lazy=False; add ensureDecompiled
Make lazy=False actually do what it says, 'load everything eagerly'. It feels weird that one has to, not only say, open with lazy=False, but also have to load each tables individually... Didn't I say don't be lazy?!

Also it can be useful to get to a eager, non-lazy font whether or not it was originally loaded lazily, so I added an ensureDecompiled method that decompiles all the tables and calls ensureDecompiled for those (e.g. cmap, glyf and otData-driven tables like GSUB, GPOS, etc.) that respect the lazy attribute.
2022-03-17 13:01:22 +00:00
Simon Cozens
4f8c01909a
Handle merging SinglePos with valueformat=0 (#2550) 2022-03-17 13:01:06 +00:00
Cosimo Lupo
ee27b73d7c BaseTTXConverter: add ensureDecompiled method
to unlazify a whole tree of otTables, recursively
2022-03-17 12:54:22 +00:00
Cosimo Lupo
64dc37fc01 otBase: add iterSubTables method to iterate over all BaseTables
can be useful to traverse a tree of otTables
2022-03-17 12:53:06 +00:00
Cosimo Lupo
7f1e5e1fc7 glyf: add ensureDecompiled method
to 'expand' all the lazy glyphs
2022-03-17 12:51:56 +00:00
Cosimo Lupo
4119d8f582 cmap: if lazy=False, decompile all cmap subtables upfront
previously cmap was completely ignoring lazy attribute, always loading lazily
2022-03-17 12:46:57 +00:00
Cosimo Lupo
ac21636137
Merge pull request #2549 from fonttools/fix-lazy-collection
fix opening TTCollection with lazy=True
2022-03-17 12:43:24 +00:00
Cosimo Lupo
83ee6bcdab ttCollection: don't close file inside init if lazy=True
Fixes 'seek of closed file' error #2549
2022-03-17 12:30:40 +00:00
Cosimo Lupo
e1b3bfc807 ttCollection_test: check loading TTCollection with lazy attribute
currently lazy=True fails with 'ValueError: seek of closed file'
2022-03-17 11:43:11 +00:00
Cosimo Lupo
71a5bf1b51
Merge pull request #2544 from fonttools/set-glyf-glyph-order
Also update glyf's glyphOrder when calling TTFont.setGlyphOrder()
2022-03-14 17:11:57 +00:00
Cosimo Lupo
c08bfc1e1a ttCollection: fix 'ResourceWarning: unclosed file'
Thanks Mike L.
2022-03-10 18:12:23 +00:00
Cosimo Lupo
e726217ae0 ttFont_test: add test for setGlyphOrder updating glyf.glyphOrder 2022-03-10 17:43:02 +00:00
Cosimo Lupo
ebe313d70e Bump version: 4.30.0 → 4.30.1.dev0 2022-03-10 11:38:46 +00:00
Cosimo Lupo
71e5ed001b Release 4.30.0 2022-03-10 11:38:45 +00:00
Cosimo Lupo
5e7bc97210 Update NEWS.rst 2022-03-10 11:38:32 +00:00
Cosimo Lupo
3529a44f75 Update glyf's glyphOrder when calling TTFont.setGlyphOrder()
https://github.com/fonttools/fonttools/issues/2060#issuecomment-1063932428
2022-03-10 11:29:17 +00:00
Cosimo Lupo
d3eb079c5d
Merge pull request #2542 from fontlaborg/main
Add debug logger showing the glyph name for which gvar is built
2022-03-10 10:21:57 +00: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
Cosimo Lupo
ac4d5611ac VarLibMergeError has cause and stack attributes, use them in subclasses
https://github.com/googlefonts/fontmake/issues/858
2022-02-25 15:39:37 +00:00