mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-15 10:42:19 +03:00
add test for #3777
This commit is contained in:
parent
92ff050bf9
commit
5f65f10191
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
NotoNastaliqUrdu-Regular.ttf, from https://github.com/googlei18n/noto-fonts
|
NotoNastaliqUrdu-Regular.ttf and NotoSansSymbols-Regular.ttf, from https://github.com/googlei18n/noto-fonts
|
||||||
NotoSansJP-Thin.otf, from https://www.google.com/get/noto/help/cjk/
|
NotoSansJP-Thin.otf, from https://www.google.com/get/noto/help/cjk/
|
||||||
AdobeVFPrototype.ttf, from https://github.com/adobe-fonts/adobe-variable-font-prototype
|
AdobeVFPrototype.ttf, from https://github.com/adobe-fonts/adobe-variable-font-prototype
|
||||||
TINY5x3GX.ttf, from http://velvetyne.fr/fonts/tiny
|
TINY5x3GX.ttf, from http://velvetyne.fr/fonts/tiny
|
||||||
|
|
BIN
Tests/fonts/NotoSansSymbols-Regular.ttf
Normal file
BIN
Tests/fonts/NotoSansSymbols-Regular.ttf
Normal file
Binary file not shown.
BIN
Tests/images/unicode_extended.png
Normal file
BIN
Tests/images/unicode_extended.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 999 B |
|
@ -459,6 +459,18 @@ class TestImageFont(PillowTestCase):
|
||||||
with self.assertRaises(UnicodeEncodeError):
|
with self.assertRaises(UnicodeEncodeError):
|
||||||
font.getsize(u"’")
|
font.getsize(u"’")
|
||||||
|
|
||||||
|
@unittest.skipIf(sys.platform.startswith('win32') and sys.version.startswith('2'),
|
||||||
|
"requires Python 3.x on Windows")
|
||||||
|
def test_unicode_render(self):
|
||||||
|
# issue #3777
|
||||||
|
text = u"A\u278A\U0001F12B"
|
||||||
|
ttf = ImageFont.truetype("Tests/fonts/NotoSansSymbols-Regular.ttf",
|
||||||
|
FONT_SIZE, layout_engine=self.LAYOUT_ENGINE)
|
||||||
|
img = Image.new("RGB", (100, 60))
|
||||||
|
d = ImageDraw.Draw(img)
|
||||||
|
d.text((10, 10), text, font=ttf)
|
||||||
|
self.assert_image_similar_tofile(img, "Tests/images/unicode_extended.png", self.metrics['textsize'])
|
||||||
|
|
||||||
def _test_fake_loading_font(self, path_to_fake, fontname):
|
def _test_fake_loading_font(self, path_to_fake, fontname):
|
||||||
# Make a copy of FreeTypeFont so we can patch the original
|
# Make a copy of FreeTypeFont so we can patch the original
|
||||||
free_type_font = copy.deepcopy(ImageFont.FreeTypeFont)
|
free_type_font = copy.deepcopy(ImageFont.FreeTypeFont)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user