From: Patrick McCarty Date: Wed, 24 Feb 2010 03:09:47 +0000 (-0800) Subject: Pango: update interface for PangoContext and PangoFontMap. X-Git-Tag: release/2.13.14-1~18 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=289ac222d171fd65ecdafd6bec28376506b0c274;p=lilypond.git Pango: update interface for PangoContext and PangoFontMap. The pango_ft2_get_context() function is deprecated. Using pango_context_new() followed by pango_context_set_font_map() accomplishes the same task. Fortunately, defining PANGO_ENABLE_BACKEND enables pango_context_new() and pango_context_set_font_map() for Pango versions older than 1.22. The recommended function, pango_font_map_create_context(), requires Pango 1.22, so avoid using it unless we absolutely have to. --- diff --git a/lily/pango-font.cc b/lily/pango-font.cc index e2dd98b9f5..a45c64f830 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -17,7 +17,10 @@ along with LilyPond. If not, see . */ -#define PANGO_ENABLE_BACKEND // ugh, why necessary? +// Necessary for supporting pango_context_new() and +// pango_context_set_font_map() in Pango < 1.22 +#define PANGO_ENABLE_BACKEND + #include #include @@ -40,14 +43,14 @@ #if HAVE_PANGO_FT2 #include "stencil.hh" -Pango_font::Pango_font (PangoFT2FontMap * /* fontmap */, +Pango_font::Pango_font (PangoFT2FontMap *fontmap, PangoFontDescription const *description, Real output_scale) { physical_font_tab_ = scm_c_make_hash_table (11); PangoDirection pango_dir = PANGO_DIRECTION_LTR; - context_ = pango_ft2_get_context (PANGO_RESOLUTION, - PANGO_RESOLUTION); + context_ = pango_context_new (); + pango_context_set_font_map (context_, PANGO_FONT_MAP (fontmap)); pango_description_ = pango_font_description_copy (description); attribute_list_ = pango_attr_list_new ();