Check for raqm version function

This commit is contained in:
Andrew Murray 2019-05-28 20:23:15 +10:00
parent 1c1447f563
commit 54c83f61bd
2 changed files with 5 additions and 5 deletions

View File

@ -112,8 +112,8 @@ class TestImagecomplextext(PillowTestCase):
try: 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: except ValueError as ex:
if str(ex) == "libraqm 0.6 or greater required for 'ttb' direction": if str(ex) == "libraqm 0.7 or greater required for 'ttb' direction":
self.skipTest('libraqm 0.6 or greater not available') self.skipTest('libraqm 0.7 or greater not available')
target = 'Tests/images/test_direction_ttb.png' target = 'Tests/images/test_direction_ttb.png'
target_img = Image.open(target) target_img = Image.open(target)

View File

@ -410,11 +410,11 @@ text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject *
else if (strcmp(dir, "ttb") == 0) { else if (strcmp(dir, "ttb") == 0) {
direction = RAQM_DIRECTION_TTB; direction = RAQM_DIRECTION_TTB;
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
if (!dlsym(p_raqm.raqm, "raqm_set_invisible_glyph")) { if (!dlsym(p_raqm.raqm, "raqm_version_atleast")) {
#else #else
if (!GetProcAddress(p_raqm.raqm, "raqm_set_invisible_glyph")) { if (!GetProcAddress(p_raqm.raqm, "raqm_version_atleast")) {
#endif #endif
PyErr_SetString(PyExc_ValueError, "libraqm 0.6 or greater required for 'ttb' direction"); PyErr_SetString(PyExc_ValueError, "libraqm 0.7 or greater required for 'ttb' direction");
goto failed; goto failed;
} }
} else { } else {