]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/pango-font.cc
Remove Font_metric::index_to_ascii.
[lilypond.git] / lily / pango-font.cc
index e2dd98b9f5d2f88acc5fbd7fe5719defc7ce1c62..6d18820b97e66eb83461a68ea1002e296623d15a 100644 (file)
   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#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 <pango/pangoft2.h>
 #include <freetype/ftxf86.h>
 
 #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 ();
@@ -121,9 +124,7 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item,
   PangoRectangle ink_rect;
   pango_glyph_string_extents (pgs, pa->font, &ink_rect, &logical_rect);
 
-  PangoFcFont *fcfont = G_TYPE_CHECK_INSTANCE_CAST (pa->font,
-                                                   PANGO_TYPE_FC_FONT,
-                                                   PangoFcFont);
+  PangoFcFont *fcfont = PANGO_FC_FONT (pa->font);
 
   FT_Face ftface = pango_fc_font_lock_face (fcfont);
 
@@ -300,13 +301,8 @@ Pango_font::physical_font_tab () const
 }
 
 Stencil
-Pango_font::word_stencil (string str, bool music_string) const
-{
-  return text_stencil (str, music_string, true);
-}
-
-Stencil
-Pango_font::text_stencil (string str, bool music_string) const
+Pango_font::text_stencil (Output_def* state,
+                          string str, bool music_string) const
 {
   return text_stencil (str, music_string, false);
 }