From f9c21b1cb3ecff7105be716954748cc91bd7aff6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 Nov 2017 12:23:52 +0530 Subject: [PATCH] Sigh, legacy linux distros --- kitty/fonts.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kitty/fonts.c b/kitty/fonts.c index fc7b53c11..21e029d02 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -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;