From 24b71ada5e158369e55aa2e63469f8b8a4e235c5 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Mon, 12 Sep 2022 16:10:02 +0200 Subject: [PATCH] Fix for font Bahnschrift - Simplify use also pftNonZero --- src/libslic3r/Emboss.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Emboss.cpp b/src/libslic3r/Emboss.cpp index ebd487c2eb..1f8788327e 100644 --- a/src/libslic3r/Emboss.cpp +++ b/src/libslic3r/Emboss.cpp @@ -66,7 +66,7 @@ ExPolygons Emboss::heal_shape(const Polygons &shape) { // When edit this code check that font 'ALIENATE.TTF' and glyph 'i' still work // fix of self intersections // http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygon.htm - ClipperLib::Paths paths = ClipperLib::SimplifyPolygons(ClipperUtils::PolygonsProvider(shape)); + ClipperLib::Paths paths = ClipperLib::SimplifyPolygons(ClipperUtils::PolygonsProvider(shape), ClipperLib::pftNonZero); ClipperLib::CleanPolygons(paths); Polygons polygons = to_polygons(paths); static const Points pts_2x2({Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 1)}); @@ -82,6 +82,10 @@ ExPolygons Emboss::heal_shape(const Polygons &shape) { polygons.push_back(rect_3x3); } } + + // TTF use non zero winding number + // https://docs.microsoft.com/en-us/typography/opentype/spec/ttch01 + // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM01/Chap1.html ExPolygons res = Slic3r::union_ex(polygons, ClipperLib::pftNonZero); Slic3r::Polygons holes;