]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/scaled-font-metric.cc
2003 -> 2004
[lilypond.git] / lily / scaled-font-metric.cc
index be07d25d8d0da39b0e45553e4d7b09c6d7b1149e..ca0039386d88c074ca4256db0c963dc1ba4553d9 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -18,6 +18,8 @@ Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
   SCM desc = m->description_;
 
   Real total_mag = magn * gh_scm2double (ly_cdr (desc));
+  assert (total_mag);
+  
   description_ = gh_cons (ly_car (desc), gh_double2scm (total_mag));
   orig_ = m;
 }
@@ -41,9 +43,17 @@ Scaled_font_metric::find_by_name (String s) const
 }
 
 Box 
-Scaled_font_metric::get_char (int i) const
+Scaled_font_metric::get_indexed_char (int i) const
+{
+  Box b = orig_->get_indexed_char (i);
+  b.scale (magnification_);
+  return b;  
+}
+
+Box 
+Scaled_font_metric::get_ascii_char (int i) const
 {
-  Box b = orig_->get_char (i);
+  Box b = orig_->get_ascii_char (i);
   b.scale (magnification_);
   return b;  
 }
@@ -62,3 +72,16 @@ Scaled_font_metric::count () const
 {
   return orig_->count ();
 }
+
+Offset
+Scaled_font_metric::get_indexed_wxwy (int k) const
+{
+  Offset o = orig_->get_indexed_wxwy (k);
+  return o * magnification_;
+}
+
+int
+Scaled_font_metric::name_to_index (String s)const
+{
+  return orig_->name_to_index (s);
+}