]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/scaled-font-metric.cc
release: 1.5.14
[lilypond.git] / lily / scaled-font-metric.cc
index 27f8c34fc37deb852728888ee6d8ada6db0d91df..cf3bb64db01d467cf31b1503600116905de90bdf 100644 (file)
@@ -1,4 +1,13 @@
-#include "font-metric.hh"
+/*   
+     scaled-font-metric.cc -- declare Scaled_font_metric
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "scaled-font-metric.hh"
 #include "string.hh"
 #include "molecule.hh"
 
@@ -8,8 +17,8 @@ Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
   magnification_f_ = magn;
   SCM desc = m->description_;
 
-  Real total_mag = magn * gh_scm2double (gh_cdr (desc));
-  description_ = gh_cons (gh_car (desc), gh_double2scm (total_mag));
+  Real total_mag = magn * gh_scm2double (ly_cdr (desc));
+  description_ = gh_cons (ly_car (desc), gh_double2scm (total_mag));
   orig_l_ = m;
 }
 
@@ -26,7 +35,30 @@ Scaled_font_metric::find_by_name (String s) const
   Molecule m = orig_l_->find_by_name (s);
   Box b = m.extent_box ();
   b.scale (magnification_f_);
-  Molecule q(b,fontify_atom ((Font_metric*) this, m.get_expr ()));
+  Molecule q (b,fontify_atom ((Font_metric*) this, m.get_expr ()));
 
   return q ;
 }
+
+Box 
+Scaled_font_metric::get_char (int i) const
+{
+  Box b = orig_l_->get_char (i);
+  b.scale (magnification_f_);
+  return b;  
+}
+
+Box
+Scaled_font_metric::text_dimension (String t) const
+{
+  Box b (orig_l_->text_dimension (t));
+
+  b.scale (magnification_f_);
+  return b;
+}
+
+int
+Scaled_font_metric::count () const
+{
+  return orig_l_->count ();
+}