diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 0425307d62af4d98d61ccb0a95fa5472e3e055fa..81cc8514aa70e23605867c8369646e4d16d647cf 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -124,7 +124,7 @@ endif() find_package(PkgConfig REQUIRED) pkg_check_modules(INKSCAPE_DEP REQUIRED - harfbuzz + harfbuzz>=2.6.5 pangocairo>=1.44 pangoft2 fontconfig diff --git a/src/libnrtype/font-instance.cpp b/src/libnrtype/font-instance.cpp index c6e4091c28db6cf7db51ed8a7c46080909a58192..195566c412d753bc12f40fcb1b570c4d6ae032b1 100644 --- a/src/libnrtype/font-instance.cpp +++ b/src/libnrtype/font-instance.cpp @@ -158,16 +158,11 @@ void FontInstance::acquire(PangoFont *p_font_, PangoFontDescription *descr_) } hb_face = hb_font_get_face(hb_font); -#if HB_VERSION_ATLEAST(2,6,5) // hb_font is immutable, yet we need to act on it (with set_funcs) to extract the freetype face hb_font_copy = hb_font_create_sub_font(hb_font); hb_ft_font_set_funcs(hb_font_copy); face = hb_ft_font_lock_face(hb_font_copy); -#else - if (face) { - pango_fc_font_unlock_face(PANGO_FC_FONT(p_font)); - } -#endif + if (!face) { release(); throw CtorException("Failed to get freetype face"); @@ -177,18 +172,13 @@ void FontInstance::acquire(PangoFont *p_font_, PangoFontDescription *descr_) // Release the resources acquired by acquire(). void FontInstance::release() { -#if HB_VERSION_ATLEAST(2,6,5) if (hb_font_copy) { if (face) { hb_ft_font_unlock_face(hb_font_copy); } hb_font_destroy(hb_font_copy); } -#else - if (face) { - pango_fc_font_unlock_face(PANGO_FC_FONT(p_font)); - } -#endif + pango_font_description_free(descr); g_object_unref(p_font); }