From de6d47ed290e02aa4bdc64d6cea5a6c8c20e61c7 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Mon, 23 Oct 2017 00:10:41 +0200 Subject: Fix compilation on Ubuntu Trusty pango_fc_font_map_get_config() is available since pango 1.38 but trusty only has pango 1.36. While calling this function is the "proper" way to get the FcConfig attached to the FontFactory's font map, FcConfigAppFontAddDir() reference says "If config is NULL, the current configuration is used." and it seems to the current configuration is suitable to use in this case (which might change if we ever start to use multiple font maps with different FcConfig's attached but should be fine for now...) --- src/libnrtype/FontFactory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 677b8abe7..95537734d 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -934,7 +934,10 @@ void font_factory::AddFontsDir(char const *utf8dir) dir = g_filename_from_utf8(utf8dir, -1, NULL, NULL, NULL); # endif - FcConfig *conf = pango_fc_font_map_get_config(PANGO_FC_FONT_MAP(fontServer)); + FcConfig *conf = NULL; +# if PANGO_VERSION_CHECK(1,38,0) + pango_fc_font_map_get_config(PANGO_FC_FONT_MAP(fontServer)); +# endif FcBool res = FcConfigAppFontAddDir(conf, (FcChar8 const *)dir); if (res = FcTrue) { g_info("Fonts dir '%s' added successfully.", utf8dir); -- cgit v1.2.3