Skip to content

Commit

Permalink
Test a font with non-ASCII filename
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Nov 28, 2018
1 parent 080bfd3 commit e4bd9a5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Tests/test_imagefont.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from PIL import Image, ImageDraw, ImageFont, features
from io import BytesIO
from shutil import copyfile
import os
import sys
import copy
Expand Down Expand Up @@ -525,6 +526,21 @@ def test_imagefont_getters(self):
self.assertEqual(t.getsize_multiline('ABC\nA'), (36, 36))
self.assertEqual(t.getsize_multiline('ABC\nAaaa'), (48, 36))

def test_unicode_filename(self):
# Arrange
unicode_filename = "Tests/fonts/Шрифты.ttf"
copyfile(FONT_PATH, unicode_filename)
size = 20

# Act
font = ImageFont.truetype(unicode_filename, size)

# Assert
self.assertEqual(font.size, size)

# Cleanup
os.remove(unicode_filename)


@unittest.skipUnless(HAS_RAQM, "Raqm not Available")
class TestImageFont_RaqmLayout(TestImageFont):
Expand Down

0 comments on commit e4bd9a5

Please sign in to comment.