Skip to content

Commit ba6a2d9

Browse files
committed
Remove overlap
1 parent 3b0b2ca commit ba6a2d9

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

Mada-Black.otf

212 Bytes
Binary file not shown.

Mada-Light.otf

248 Bytes
Binary file not shown.

Mada-Regular.otf

188 Bytes
Binary file not shown.

tools/build.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import math
66
import os
77

8+
from booleanOperations import BooleanOperationManager
89
from cu2qu.ufo import font_to_quadratic
910
from datetime import datetime
1011
from defcon import Font, Component
@@ -235,8 +236,18 @@ def subsetGlyphs(otf, ufo):
235236
subsetter.subset(otf)
236237
return otf
237238

239+
def removeOverlap(ufo):
240+
manager = BooleanOperationManager()
241+
for glyph in ufo:
242+
contours = list(glyph)
243+
glyph.clearContours()
244+
manager.union(contours, glyph.getPointPen())
245+
return ufo
246+
238247
def build(args):
239248
ufo, fea = merge(args)
249+
ufo = removeOverlap(ufo)
250+
240251
if args.out_file.endswith(".ttf"):
241252
font_to_quadratic(ufo)
242253
otfCompiler = TTFCompiler(ufo)

0 commit comments

Comments
 (0)