Skip to content

Commit

Permalink
Changed test to use CJK characters
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed May 27, 2019
1 parent b5ede4f commit 55e87b9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Tests/fonts/LICENSE.txt
@@ -1,7 +1,6 @@

NotoNastaliqUrdu-Regular.ttf:

(from https://github.com/googlei18n/noto-fonts)
NotoNastaliqUrdu-Regular.ttf, from https://github.com/googlei18n/noto-fonts
NotoSansJP-Thin.otf, from https://www.google.com/get/noto/help/cjk/

All Noto fonts are published under the SIL Open Font License (OFL) v1.1 (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL), which allows you to copy, modify, and redistribute them if you need to.

Expand Down
Binary file added Tests/fonts/NotoSansJP-Regular.otf
Binary file not shown.
Binary file modified Tests/images/test_direction_ttb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Tests/test_imagefontctl.py
Expand Up @@ -105,12 +105,12 @@ def test_text_direction_rtl2(self):
self.assert_image_similar(im, target_img, .5)

def test_text_direction_ttb(self):
ttf = ImageFont.truetype(FONT_PATH, FONT_SIZE)
ttf = ImageFont.truetype("Tests/fonts/NotoSansJP-Regular.otf", 30)

im = Image.new(mode='RGB', size=(100, 300))
draw = ImageDraw.Draw(im)
try:
draw.text((0, 0), 'English عربي', font=ttf, fill=500, direction='ttb')
draw.text((0, 0), 'English あい', font=ttf, fill=500, direction='ttb')
except ValueError as ex:
if str(ex) == "libraqm 0.6 or greater required for 'ttb' direction":
self.skipTest('libraqm 0.6 or greater not available')
Expand Down

0 comments on commit 55e87b9

Please sign in to comment.