Merge pull request #2825 from fonttools/issue2824
Fix for #2824: fix arguments in calls to (glyf) glyph.draw() and glyph.drawPoints()
This commit is contained in:
commit
f658ca0499
@ -126,14 +126,14 @@ class _TTGlyphGlyf(_TTGlyph):
|
||||
how that works.
|
||||
"""
|
||||
glyph, offset = self._getGlyphAndOffset()
|
||||
glyph.draw(pen, offset)
|
||||
glyph.draw(pen, self.glyphSet.glyfTable, offset)
|
||||
|
||||
def drawPoints(self, pen):
|
||||
"""Draw the glyph onto ``pen``. See fontTools.pens.pointPen for details
|
||||
how that works.
|
||||
"""
|
||||
glyph, offset = self._getGlyphAndOffset()
|
||||
glyph.drawPoints(pen, offset)
|
||||
glyph.drawPoints(pen, self.glyphSet.glyfTable, offset)
|
||||
|
||||
def _getGlyphAndOffset(self):
|
||||
if self.glyphSet.location and self.glyphSet.gvarTable is not None:
|
||||
@ -176,12 +176,12 @@ class _TTGlyphGlyf(_TTGlyph):
|
||||
|
||||
glyph = copy(glyfTable[self.name]) # Shallow copy
|
||||
width, lsb, height, tsb = _setCoordinates(glyph, coordinates, glyfTable)
|
||||
self.lsb = lsb
|
||||
self.tsb = tsb
|
||||
if glyphSet.hvarTable is None:
|
||||
# no HVAR: let's set metrics from the phantom points
|
||||
self.width = width
|
||||
self.lsb = lsb
|
||||
self.height = height
|
||||
self.tsb = tsb
|
||||
return glyph
|
||||
|
||||
|
||||
|
BIN
Tests/ttLib/data/issue2824.ttf
Normal file
BIN
Tests/ttLib/data/issue2824.ttf
Normal file
Binary file not shown.
@ -112,6 +112,18 @@ class TTGlyphSetTest(object):
|
||||
("closePath", ()),
|
||||
],
|
||||
),
|
||||
(
|
||||
"issue2824.ttf",
|
||||
None,
|
||||
[
|
||||
("moveTo", ((309, 180),)),
|
||||
("qCurveTo", ((274, 151), (187, 136), (104, 166), (74, 201))),
|
||||
("qCurveTo", ((45, 236), (30, 323), (59, 407), (95, 436))),
|
||||
("qCurveTo", ((130, 466), (217, 480), (301, 451), (330, 415))),
|
||||
("qCurveTo", ((360, 380), (374, 293), (345, 210), (309, 180))),
|
||||
("closePath", ()),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_glyphset(self, fontfile, location, expected):
|
||||
|
Loading…
x
Reference in New Issue
Block a user