]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4876/2: Enable fontname replacing in Open_type_font class
authorMasamichi Hosoda <trueroad@trueroad.jp>
Sat, 25 Jun 2016 02:12:11 +0000 (11:12 +0900)
committerMasamichi Hosoda <trueroad@trueroad.jp>
Mon, 4 Jul 2016 12:46:34 +0000 (21:46 +0900)
This commit enables fontname replacing for CFF (OTF/OTC) fonts.

lily/include/open-type-font.hh
lily/open-type-font.cc

index bf36071e9139adc3f12b03f80dbe347a43c760fa..b86a560a73272bc4dc6b963c850a7fcc05f15924 100644 (file)
@@ -30,6 +30,7 @@ class Open_type_font : public Font_metric
 {
   /* handle to face object */
   FT_Face face_;
+  string postscript_name_;
 
   SCM lily_subfonts_;
   SCM lily_character_table_;
index e4fb5d5d988a585266884076bc40c727dc943ef3..39e7b524ff91dcda8b48d6d50053f96bf2af0c90 100644 (file)
@@ -220,6 +220,8 @@ Open_type_font::Open_type_font (FT_Face face)
   index_to_charcode_map_ = make_index_to_charcode_map (face_);
 
   lily_index_to_bbox_table_ = scm_c_make_hash_table (257);
+
+  postscript_name_ = get_postscript_name (face_);
 }
 
 void
@@ -399,7 +401,7 @@ Open_type_font::get_global_table () const
 string
 Open_type_font::font_name () const
 {
-  return FT_Get_Postscript_Name (face_);
+  return postscript_name_;
 }
 
 SCM