]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/font-metric-scheme.cc
Build fixes.
[lilypond.git] / lily / font-metric-scheme.cc
index bcb034174e6561ee1e7e840fe948bb303dffb3c6..d04d1eab8ad8c7213a1cdb3468b2f5310a357bda 100644 (file)
@@ -6,8 +6,10 @@
   (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "stencil.hh"
 #include "font-metric.hh"
+
+#include "warn.hh"
+#include "stencil.hh"
 #include "modified-font-metric.hh"
 
 LY_DEFINE (ly_font_get_glyph, "ly:font-get-glyph",
@@ -72,11 +74,8 @@ LY_DEFINE (ly_font_glyph_name_to_charcode, "ly:font-glyph-name-to-charcode",
   Font_metric *fm = unsmob_metrics (font);
   SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
   SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG2, __FUNCTION__, "string");
-#if 1
+
   return scm_from_unsigned_integer (fm->index_to_charcode (fm->name_to_index (ly_scm2string (name))));
-#else
-  return scm_from_unsigned_integer (fm->glyph_name_to_charcode (ly_scm2string (name)));
-#endif
 }
 
 LY_DEFINE (ly_text_dimension, "ly:text-dimension",
@@ -97,6 +96,10 @@ LY_DEFINE (ly_text_dimension, "ly:text-dimension",
                   ly_interval2scm (stc.extent (Y_AXIS)));
 }
 
+
+/*
+  TODO: when are non string retvals allowed?
+ */
 LY_DEFINE (ly_font_file_name, "ly:font-file-name",
           1, 0, 0,
           (SCM font),
@@ -105,7 +108,9 @@ LY_DEFINE (ly_font_file_name, "ly:font-file-name",
 {
   Font_metric *fm = unsmob_metrics (font);
   SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  return fm->font_file_name ();
+  SCM name = fm->font_file_name ();
+
+  return name;
 }
 
 LY_DEFINE (ly_font_name, "ly:font-name",