]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/modified-font-metric.cc
Web-ja: update introduction
[lilypond.git] / lily / modified-font-metric.cc
index 7a54948fed13a96882fc40d0567cd34de9708d09..a3beb4daefa0665be7fd0bacef73fe19571e49ef 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1999--2015 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
@@ -26,6 +26,11 @@ using namespace std;
 #include "main.hh"
 #include "program-option.hh"
 
+Preinit_Modified_font_metric::Preinit_Modified_font_metric ()
+{
+  orig_ = 0;
+}
+
 Modified_font_metric::Modified_font_metric (Font_metric *fm,
                                             Real magnification)
 {
@@ -74,7 +79,7 @@ Modified_font_metric::count () const
 }
 
 Offset
-Modified_font_metric::attachment_point (string s) const
+Modified_font_metric::attachment_point (const string &s) const
 {
   Offset o = orig_->attachment_point (s);
   return o * magnification_;
@@ -87,7 +92,7 @@ Modified_font_metric::get_indexed_wxwy (vsize k) const
   return o * magnification_;
 }
 
-vsize
+size_t
 Modified_font_metric::name_to_index (string s) const
 {
   return orig_->name_to_index (s);
@@ -102,16 +107,20 @@ Modified_font_metric::index_to_charcode (vsize i) const
 void
 Modified_font_metric::derived_mark () const
 {
+  if (orig_)
+    scm_gc_mark (orig_->self_scm ());
 }
 
 Stencil
 Modified_font_metric::text_stencil (Output_def *state,
-                                    string text, bool feta) const
+                                    const string &text,
+                                    bool feta,
+                                    const string &features_str) const
 {
   Box b;
   if (Pango_font *pf = dynamic_cast<Pango_font *> (orig_))
     {
-      Stencil stc = pf->text_stencil (state, text, feta);
+      Stencil stc = pf->text_stencil (state, text, feta, features_str);
 
       Box b = stc.extent_box ();
 
@@ -120,7 +129,7 @@ Modified_font_metric::text_stencil (Output_def *state,
       return scaled;
     }
 
-  return Font_metric::text_stencil (state, text, feta);
+  return Font_metric::text_stencil (state, text, feta, features_str);
 }
 
 Font_metric *