Skip to content

Commit

Permalink
Merge 6de54a9 into 04c222c
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed May 31, 2019
2 parents 04c222c + 6de54a9 commit 5d95267
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 84 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 added 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.
16 changes: 16 additions & 0 deletions Tests/test_imagefontctl.py
Expand Up @@ -104,6 +104,22 @@ def test_text_direction_rtl2(self):

self.assert_image_similar(im, target_img, .5)

def test_text_direction_ttb(self):
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')
except ValueError as ex:
if str(ex) == "libraqm 0.7 or greater required for 'ttb' direction":
self.skipTest('libraqm 0.7 or greater not available')

target = 'Tests/images/test_direction_ttb.png'
target_img = Image.open(target)

self.assert_image_similar(im, target_img, .65)

def test_ligature_features(self):
ttf = ImageFont.truetype(FONT_PATH, FONT_SIZE)

Expand Down

0 comments on commit 5d95267

Please sign in to comment.