You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 20, 2022. It is now read-only.
Strangely the contours are still in the TTF, just wrong winding direction. I wonder, is this yet another manifestation of @MatthewBlanchard's Skia bug?
Just an update. This is what it looks like post-№497140 (@MatthewBlanchard—Changed aswinding to use the signed area of the polygon defined by the contour's control points instead of the derivative of the left edge to determine winding direction.)
Much better, but not perfect.
To achieve this result I applied this patch to @simoncozens code:
diff --git a/crates/fonttools-cli/src/bin/ttf-remove-overlap.rs b/crates/fonttools-cli/src/bin/ttf-remove-overlap.rs
index d402dbb..53bd5e1 100644
--- a/crates/fonttools-cli/src/bin/ttf-remove-overlap.rs+++ b/crates/fonttools-cli/src/bin/ttf-remove-overlap.rs@@ -1,8 +1,7 @@
use fonttools::tables::glyf::{Glyph, Point};
-use fonttools::tag;
use fonttools_cli::{open_font, read_args, save_font};
-use skia_safe::{simplify, Path};+use skia_safe::{Path, PathOp};
fn remove_overlap(g: &mut Glyph) {
if g.has_components() || g.is_empty() {
@@ -46,7 +45,7 @@ fn remove_overlap(g: &mut Glyph) {
}
path.close();
}
- if let Some(newpath) = simplify(&path) {+ if let Some(Some(newpath)) = path.op(&path, PathOp::Union).map(|p| p.as_winding()) {
g.contours = skia_to_glyf(newpath);
}
}
Input was FRBAmericanCursive-400-Regular.zip
…it's fast and wrong though, as opposed to slow and wrong as fontmake often is (though not this wrong)!
The text was updated successfully, but these errors were encountered: