lilypond-1.3.100
[lilypond.git] / lily / scaled-font-metric.cc
blob27f8c34fc37deb852728888ee6d8ada6db0d91df
1 #include "font-metric.hh"
2 #include "string.hh"
3 #include "molecule.hh"
6 Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
8 magnification_f_ = magn;
9 SCM desc = m->description_;
11 Real total_mag = magn * gh_scm2double (gh_cdr (desc));
12 description_ = gh_cons (gh_car (desc), gh_double2scm (total_mag));
13 orig_l_ = m;
16 SCM
17 Scaled_font_metric::make_scaled_font_metric (Font_metric*m, Real s)
19 Scaled_font_metric *sfm = new Scaled_font_metric (m,s);
20 return sfm->self_scm ();
23 Molecule
24 Scaled_font_metric::find_by_name (String s) const
26 Molecule m = orig_l_->find_by_name (s);
27 Box b = m.extent_box ();
28 b.scale (magnification_f_);
29 Molecule q(b,fontify_atom ((Font_metric*) this, m.get_expr ()));
31 return q ;