Fixed raqm layout bug

This commit is contained in:
Andrew Murray 2019-04-11 15:36:33 +10:00
parent ee063af32f
commit b742d1511e
4 changed files with 12 additions and 3 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -54,6 +54,18 @@ class TestImagecomplextext(PillowTestCase):
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):
ttf = ImageFont.truetype(FONT_PATH, FONT_SIZE)

View File

@ -755,9 +755,6 @@ font_render(FontObject* self, PyObject* args)
}
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;
error = FT_Load_Glyph(self->face, index, load_flags);
if (error)