]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/pango-select.cc
(LY_DEFINE): new file.
[lilypond.git] / lily / pango-select.cc
index c49c63cf37934a579004f55097555fc40e62004f..3fa18f2de97a7bd25e815b20d37811085af9f2f4 100644 (file)
@@ -13,8 +13,9 @@
 #include "output-def.hh"
 #include "pango-font.hh"
 
-Font_metric *
-select_pango_font (Output_def *layout, SCM chain)
+
+PangoFontDescription *
+properties_to_pango_description (SCM chain, Real text_size)
 {
   SCM name = ly_chain_assoc (ly_symbol2scm ("font-name"), chain);
 
@@ -42,17 +43,25 @@ select_pango_font (Output_def *layout, SCM chain)
     }
 
   Real step = robust_scm2double (ly_symbol2scm ("font-size"), 0.0);
-  Real size = layout->get_dimension (ly_symbol2scm ("text-font-size"))
+  Real size = text_size
     * pow (2.0, step / 6.0) * point_constant;
+  
   pango_font_description_set_size (description,
                                   gint (size * PANGO_SCALE));
-  
-  Font_metric * fm = all_fonts_global->find_pango_font (description);
+  return description;
+}
+
+Font_metric *
+select_pango_font (Output_def *layout, SCM chain)
+{
+  PangoFontDescription *pfd =properties_to_pango_description (chain,
+                                  layout->get_dimension (ly_symbol2scm ("text-font-size")));
+
+  Font_metric * fm = all_fonts_global->find_pango_font (pfd);
 
   return find_scaled_font (layout, fm, 1.0);
 }
 
-
 PangoStyle
 symbol_to_pango_style (SCM style)
 {