]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/open-type-font.cc
remove PDF related files
[lilypond.git] / lily / open-type-font.cc
index da9677f07333355cb136d0abc206e8f0e90be12b..dabbbba28609171f2ed58bdcabaf45991e260005 100644 (file)
@@ -3,8 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include <map>
 #include "dimensions.hh"
 #include "modified-font-metric.hh"
 
-const Real point_constant = 1 PT;
-
 FT_Byte *
 load_table (char const *tag_str, FT_Face face, FT_ULong *length)
 {
-  FT_ULong tag = FT_MAKE_TAG(tag_str[0], tag_str[1], tag_str[2], tag_str[3]);
+  FT_ULong tag = FT_MAKE_TAG (tag_str[0], tag_str[1], tag_str[2], tag_str[3]);
 
   int error_code = FT_Load_Sfnt_Table (face, tag, 0, NULL, length);
   if (!error_code)
@@ -33,9 +30,7 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length)
 
       error_code = FT_Load_Sfnt_Table (face, tag, 0, buffer, length );
       if (error_code)
-       {
-         error (_f ("Could not load %s font table", tag_str));
-       }
+       error (_f ("Could not load %s font table", tag_str));
 
       return buffer;
     }
@@ -61,7 +56,6 @@ load_scheme_table (char const *tag_str, FT_Face face)
   return tab;
 }
 
-
 Index_to_charcode_map 
 make_index_to_charcode_map (FT_Face face)
 {
@@ -182,7 +176,7 @@ Open_type_font::get_indexed_char (int signed_idx) const
   Box b (Interval (-hb, m.width - hb),
         Interval (-vb, m.height - vb));
 
-  b.scale (design_size () * Real (point_constant) / face_->units_per_EM);
+  b.scale (design_size ()  / Real (face_->units_per_EM));
   return b;
 }
 
@@ -215,12 +209,12 @@ Open_type_font::design_size () const
 
                             /*
                               Hmm. Design size is arbitrary for
-                              non-designe-size fonts. I vote for 1 -
+                              non-design-size fonts. I vote for 1 -
                               which will trip errors more
                               quickly. --hwn.
                              */
                             scm_from_int (1));
-  return scm_to_double (entry);
+  return scm_to_double (entry) * Real (point_constant);
 }
 
 
@@ -273,3 +267,10 @@ Open_type_font::get_global_table () const
 {
   return lily_global_table_;
 }
+
+String
+Open_type_font::font_name () const
+{
+  return FT_Get_Postscript_Name (face_);
+}
+