]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/pango-select.cc
Be const correct in Open_type_font::index_to_charcode()
[lilypond.git] / lily / pango-select.cc
index 6f832e7621fb8511d51c1a1d440d3c4483eef3b6..e5093768156a437eb7227b3a2a198218c48be52c 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  pango-select.cc -- implement lily font selection for Pango_fonts.
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2004--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-  (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "dimensions.hh"
@@ -19,7 +30,7 @@ properties_to_pango_description (SCM chain, Real text_size)
   PangoFontDescription *description = 0;
   if (scm_is_string (name))
     {
-      std::string name_str = ly_scm2string (name);
+      string name_str = ly_scm2string (name);
       description = pango_font_description_from_string (name_str.c_str ());
     }
   else
@@ -43,8 +54,7 @@ properties_to_pango_description (SCM chain, Real text_size)
                                 0.0);
   Real size = text_size * pow (2.0, step / 6.0);
 
-  pango_font_description_set_size (description,
-                                  gint (size * PANGO_SCALE));
+  pango_font_description_set_size (description, gint (size * PANGO_SCALE));
   return description;
 }
 
@@ -57,9 +67,10 @@ select_pango_font (Output_def *layout, SCM chain)
                                       * layout->get_dimension (ly_symbol2scm ("text-font-size")));
 
   char *str = pango_font_description_to_string (pfd);
-  SCM scm_str = scm_makfrom0str (str);
+  SCM scm_str = scm_from_locale_string (str);
   g_free (str);
-
+  pango_font_description_free (pfd);
+  
   return find_pango_font (layout, scm_str, 1.0);
 }
 
@@ -133,7 +144,7 @@ symbols_to_pango_font_description (SCM family,
 {
   PangoFontDescription *description = pango_font_description_new ();
 
-  std::string family_str = "roman";
+  string family_str = "roman";
   if (scm_is_symbol (family))
     family_str = ly_symbol2string (family);
   else if (scm_is_string (family))