[cubic-glyf] Add test for offcurve wrap-around and all-offcurve
This commit is contained in:
parent
9c60b86b46
commit
5e141f027b
BIN
Tests/ttLib/data/dot-cubic.ttf
Normal file
BIN
Tests/ttLib/data/dot-cubic.ttf
Normal file
Binary file not shown.
@ -544,3 +544,38 @@ class TTGlyphSetTest(object):
|
||||
pen = RecordingPointPen()
|
||||
glyph.drawPoints(pen)
|
||||
assert pen.value
|
||||
|
||||
def test_cubic_glyf(self):
|
||||
font = TTFont(self.getpath("dot-cubic.ttf"))
|
||||
glyphset = font.getGlyphSet()
|
||||
|
||||
expected = [
|
||||
("moveTo", ((76, 181),)),
|
||||
("curveTo", ((103, 181), (125, 158), (125, 131))),
|
||||
("curveTo", ((125, 104), (103, 82), (76, 82))),
|
||||
("curveTo", ((48, 82), (26, 104), (26, 131))),
|
||||
("curveTo", ((26, 158), (48, 181), (76, 181))),
|
||||
("closePath", ()),
|
||||
]
|
||||
|
||||
pen = RecordingPen()
|
||||
glyphset["glyph00001"].draw(pen)
|
||||
assert pen.value == expected
|
||||
|
||||
pen = RecordingPen()
|
||||
glyphset["glyph00002"].draw(pen)
|
||||
assert pen.value == expected
|
||||
|
||||
pen = RecordingPen()
|
||||
glyphset["glyph00003"].draw(pen)
|
||||
assert pen.value == expected
|
||||
|
||||
pen = RecordingPen()
|
||||
glyphset["glyph00004"].draw(pen)
|
||||
assert pen.value == [
|
||||
("curveTo", ((103, 181), (125, 158), (125, 131))),
|
||||
("curveTo", ((125, 104), (103, 82), (75.5, 82))),
|
||||
("curveTo", ((48, 82), (26, 104), (26, 131))),
|
||||
("curveTo", ((26, 158), (48, 181), (75.5, 181))),
|
||||
("closePath", ()),
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user