14 Commits

Author SHA1 Message Date
Cosimo Lupo
971043374e instancer: add --ignore-overlap-errors option
This is to be able to ignore tricky glyphs that sometimes trip up Skia PathOps.Simplify operation.
We have no idea how to fix this upstream (short of having the glyphs redrawn), and perfect is the enemy of good..
2021-07-29 16:59:04 +02:00
Cosimo Lupo
b0e24384c2 minor refactorings following review comment
https://github.com/fonttools/fonttools/pull/2288#discussion_r627907922
2021-05-07 09:49:40 +01:00
Cosimo Lupo
d4d3d95414 split simplify logic to separate func for easier unit-testing 2021-05-06 20:23:56 +01:00
Cosimo Lupo
84b851398b removeOverlaps: try rounding to ints before simplify to workaround skia bug
Fixes https://github.com/google/fonts/issues/3365

See https://bugs.chromium.org/p/skia/issues/detail?id=11958 for details
2021-05-06 14:16:01 +01:00
Cosimo Lupo
e13b781526 removeOverlaps: print glyph name when pathops.simplify fails
Sometimes skia-pathops simplify may fail (for unknown reasons which I'm still trying to debug).
It's a good idea to know the name of the offending glyph
https://github.com/google/fonts/issues/3365
2021-05-04 17:08:59 +01:00
Cosimo Lupo
7f9462dfa6
compare paths independently of contour order
the order of contours modified by Skia is not stable and may change. So when we compare the original and the modified paths, we compare the paths as unordered sets of contours.

The order of contours doesn't produce any visible difference, but we try to keep the changes to the minimum here to avoid unnecessary diffs
2020-09-30 13:40:01 +01:00
Cosimo Lupo
66a0d91bf9
remove hinting from all glyphs, whether overlaps are removed or not 2020-09-30 13:36:28 +01:00
Cosimo Lupo
e94098606b
log modified glyps 2020-09-30 13:35:05 +01:00
Cosimo Lupo
7b9da7602c
skip empty paths with no contours
https://github.com/fonttools/fonttools/pull/2068#pullrequestreview-498472660
2020-09-29 16:24:17 +01:00
Cosimo Lupo
e1ad83add7
minor edit to comment [skip ci] 2020-09-29 14:44:51 +01:00
Cosimo Lupo
da439c7c57
decompose composites only if components intersect; let pathops.PathPen decompose components
requires https://github.com/fonttools/skia-pathops/pull/32
2020-09-29 14:14:55 +01:00
Cosimo Lupo
015d8265d2
use pathops.simplify() and remember if original path direction
pathops.simplify() returns a copy so we don't need to make a copy ourselves.

'clockwise' option is defined in https://github.com/fonttools/skia-pathops/pull/31
2020-09-27 17:31:30 +01:00
Cosimo Lupo
0ceb146196
process simple glyphs before composites
to avoid decomposing only because a component's base glyph contains overlaps.
2020-09-27 17:29:25 +01:00
Cosimo Lupo
2bcc103c36
move it to ttLib.removeOverlaps module 2020-09-23 19:13:58 +01:00