]> git.donarmstrong.com Git - lilypond.git/blob - lily/scaled-font-metric.cc
release: 1.3.100
[lilypond.git] / lily / scaled-font-metric.cc
1 #include "font-metric.hh"
2 #include "string.hh"
3 #include "molecule.hh"
4
5
6 Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
7 {
8   magnification_f_ = magn;
9   SCM desc = m->description_;
10
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;
14 }
15
16 SCM
17 Scaled_font_metric::make_scaled_font_metric (Font_metric*m, Real s)
18 {
19   Scaled_font_metric *sfm = new Scaled_font_metric (m,s);
20   return sfm->self_scm ();
21 }
22
23 Molecule
24 Scaled_font_metric::find_by_name (String s) const
25 {
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 ()));
30
31   return q ;
32 }