mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Fixed raqm layout bug
This commit is contained in:
parent
ee063af32f
commit
b742d1511e
BIN
Tests/fonts/KhmerOSBattambang-Regular.ttf
Executable file
BIN
Tests/fonts/KhmerOSBattambang-Regular.ttf
Executable file
Binary file not shown.
BIN
Tests/images/test_complex_unicode_text2.png
Normal file
BIN
Tests/images/test_complex_unicode_text2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -54,6 +54,18 @@ class TestImagecomplextext(PillowTestCase):
|
||||||
|
|
||||||
self.assert_image_similar(im, target_img, .5)
|
self.assert_image_similar(im, target_img, .5)
|
||||||
|
|
||||||
|
ttf = ImageFont.truetype("Tests/fonts/KhmerOSBattambang-Regular.ttf",
|
||||||
|
FONT_SIZE)
|
||||||
|
|
||||||
|
im = Image.new(mode='RGB', size=(300, 100))
|
||||||
|
draw = ImageDraw.Draw(im)
|
||||||
|
draw.text((0, 0), 'លោកុប្បត្តិ', font=ttf, fill=500)
|
||||||
|
|
||||||
|
target = 'Tests/images/test_complex_unicode_text2.png'
|
||||||
|
target_img = Image.open(target)
|
||||||
|
|
||||||
|
self.assert_image_similar(im, target_img, 2.3)
|
||||||
|
|
||||||
def test_text_direction_rtl(self):
|
def test_text_direction_rtl(self):
|
||||||
ttf = ImageFont.truetype(FONT_PATH, FONT_SIZE)
|
ttf = ImageFont.truetype(FONT_PATH, FONT_SIZE)
|
||||||
|
|
||||||
|
|
|
@ -755,9 +755,6 @@ font_render(FontObject* self, PyObject* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (x = i = 0; i < count; i++) {
|
for (x = i = 0; i < count; i++) {
|
||||||
if (i == 0 && self->face->glyph->metrics.horiBearingX < 0)
|
|
||||||
x = -self->face->glyph->metrics.horiBearingX;
|
|
||||||
|
|
||||||
index = glyph_info[i].index;
|
index = glyph_info[i].index;
|
||||||
error = FT_Load_Glyph(self->face, index, load_flags);
|
error = FT_Load_Glyph(self->face, index, load_flags);
|
||||||
if (error)
|
if (error)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user