[ttGlyphPen_test] add test for decomposeOverflowingTransform=False
This commit is contained in:
parent
56be13915b
commit
6ce8eec89c
@ -3,6 +3,7 @@ from fontTools.misc.py23 import *
|
||||
|
||||
import os
|
||||
import unittest
|
||||
import struct
|
||||
|
||||
from fontTools import ttLib
|
||||
from fontTools.misc.testTools import TestCase
|
||||
@ -217,6 +218,27 @@ class TTGlyphPenTest(TestCase):
|
||||
|
||||
self.assertEqual(expectedGlyph, compositeGlyph)
|
||||
|
||||
def test_no_decompose_overflowing_transform(self):
|
||||
componentName = 'a'
|
||||
glyphSet = {}
|
||||
pen = TTGlyphPen(glyphSet, decomposeOverflowingTransform=False)
|
||||
|
||||
pen.moveTo((0, 0))
|
||||
pen.lineTo((0, 1))
|
||||
pen.lineTo((1, 0))
|
||||
pen.closePath()
|
||||
baseGlyph = pen.glyph()
|
||||
glyphSet[componentName] = _TestGlyph(baseGlyph)
|
||||
|
||||
pen.addComponent(componentName, (3, 0, 0, 1, 0, 0))
|
||||
compositeGlyph = pen.glyph()
|
||||
|
||||
self.assertEqual(compositeGlyph.components[0].transform,
|
||||
((3, 0), (0, 1)))
|
||||
|
||||
with self.assertRaises(struct.error):
|
||||
compositeGlyph.compile({'a': baseGlyph})
|
||||
|
||||
|
||||
class _TestGlyph(object):
|
||||
def __init__(self, glyph):
|
||||
|
Loading…
x
Reference in New Issue
Block a user