[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.
This commit is contained in:
parent
3165cc132a
commit
6b4e2e7147
@ -95,11 +95,11 @@ class Glyph:
|
|||||||
self.glyphName = glyphName
|
self.glyphName = glyphName
|
||||||
self.glyphSet = glyphSet
|
self.glyphSet = glyphSet
|
||||||
|
|
||||||
def draw(self, pen):
|
def draw(self, pen, outputImpliedClosingLine=False):
|
||||||
"""
|
"""
|
||||||
Draw this glyph onto a *FontTools* Pen.
|
Draw this glyph onto a *FontTools* Pen.
|
||||||
"""
|
"""
|
||||||
pointPen = PointToSegmentPen(pen)
|
pointPen = PointToSegmentPen(pen, outputImpliedClosingLine=outputImpliedClosingLine)
|
||||||
self.drawPoints(pointPen)
|
self.drawPoints(pointPen)
|
||||||
|
|
||||||
def drawPoints(self, pointPen):
|
def drawPoints(self, pointPen):
|
||||||
|
@ -166,7 +166,10 @@ def test(glyphsets, glyphs=None, names=None):
|
|||||||
perContourPen = PerContourOrComponentPen(
|
perContourPen = PerContourOrComponentPen(
|
||||||
RecordingPen, glyphset=glyphset
|
RecordingPen, glyphset=glyphset
|
||||||
)
|
)
|
||||||
glyph.draw(perContourPen)
|
try:
|
||||||
|
glyph.draw(perContourPen, outputImpliedClosingLine=True)
|
||||||
|
except TypeError:
|
||||||
|
glyph.draw(perContourPen)
|
||||||
contourPens = perContourPen.value
|
contourPens = perContourPen.value
|
||||||
del perContourPen
|
del perContourPen
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user