]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/scaled-font-metric.cc
($(outdir)/%.pdf): add DVIPS_FLAGS. This will
[lilypond.git] / lily / scaled-font-metric.cc
index c815c086cc9c0f1539046d4ef1d28527bc7f3dfc..b3a07b3270200529662b76b606c20a1ddbc1b244 100644 (file)
@@ -3,23 +3,25 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "scaled-font-metric.hh"
 #include "string.hh"
-#include "molecule.hh"
+#include "stencil.hh"
 
 
 Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
 {
-  magnification_f_ = magn;
+  magnification_ = magn;
   SCM desc = m->description_;
 
-  Real total_mag = magn * gh_scm2double (gh_cdr (desc));
-  description_ = gh_cons (gh_car (desc), gh_double2scm (total_mag));
-  orig_l_ = m;
+  Real total_mag = magn * gh_scm2double (ly_cdr (desc));
+  assert (total_mag);
+  
+  description_ = gh_cons (ly_car (desc), gh_double2scm (total_mag));
+  orig_ = m;
 }
 
 SCM
@@ -29,30 +31,57 @@ Scaled_font_metric::make_scaled_font_metric (Font_metric*m, Real s)
   return sfm->self_scm ();
 }
 
-Molecule
+Stencil
 Scaled_font_metric::find_by_name (String s) const
 {
-  Molecule m = orig_l_->find_by_name (s);
+  Stencil m = orig_->find_by_name (s);
   Box b = m.extent_box ();
-  b.scale (magnification_f_);
-  Molecule q (b,fontify_atom ((Font_metric*) this, m.get_expr ()));
+  b.scale (magnification_);
+  Stencil q (b,fontify_atom ((Font_metric*) this, m.get_expr ()));
 
   return q ;
 }
 
 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_l_->get_char (i);
-  b.scale (magnification_f_);
+  Box b = orig_->get_ascii_char (i);
+  b.scale (magnification_);
   return b;  
 }
 
 Box
 Scaled_font_metric::text_dimension (String t) const
 {
-  Box b (orig_l_->text_dimension (t));
+  Box b (orig_->text_dimension (t));
 
-  b.scale (magnification_f_);
+  b.scale (magnification_);
   return b;
 }
+
+int
+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);
+}