Sigh, legacy linux distros

This commit is contained in:
Kovid Goyal 2017-11-04 12:23:52 +05:30
parent 58be99a27e
commit f9c21b1cb3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -8,6 +8,10 @@
#include "fonts.h"
#include "state.h"
#if HB_VERSION_MAJOR > 0 || (HB_VERSION_MAJOR == 0 && (HB_VERSION_MINOR > 9 || (HB_VERSION_MINOR == 9 && HB_VERSION_MICRO >= 42)))
#define HARBUZZ_HAS_SET_CLUSTER_LEVEL
#endif
#define MISSING_GLYPH 4
typedef uint16_t glyph_index;
@ -671,7 +675,9 @@ init_fonts(PyObject *module) {
}
harfbuzz_buffer = hb_buffer_create();
if (harfbuzz_buffer == NULL || !hb_buffer_allocation_successful(harfbuzz_buffer) || !hb_buffer_pre_allocate(harfbuzz_buffer, 2048)) { PyErr_NoMemory(); return false; }
#ifdef HARBUZZ_HAS_SET_CLUSTER_LEVEL
hb_buffer_set_cluster_level(harfbuzz_buffer, HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS);
#endif
if (PyModule_AddFunctions(module, module_methods) != 0) return false;
current_send_sprite_to_gpu = send_sprite_to_gpu;
return true;