* Documentation/user/tutorial.itely (A lead sheet): remove
[lilypond.git] / lily / scaled-font-metric.cc
blob8583887b5855aa225ad2ae78ada741f371b15531
1 /*
2 scaled-font-metric.cc -- declare Scaled_font_metric
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "scaled-font-metric.hh"
11 #include "string.hh"
12 #include "molecule.hh"
15 Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
17 magnification_ = magn;
18 SCM desc = m->description_;
20 Real total_mag = magn * gh_scm2double (ly_cdr (desc));
21 assert (total_mag);
23 description_ = gh_cons (ly_car (desc), gh_double2scm (total_mag));
24 orig_ = m;
27 SCM
28 Scaled_font_metric::make_scaled_font_metric (Font_metric*m, Real s)
30 Scaled_font_metric *sfm = new Scaled_font_metric (m,s);
31 return sfm->self_scm ();
34 Molecule
35 Scaled_font_metric::find_by_name (String s) const
37 Molecule m = orig_->find_by_name (s);
38 Box b = m.extent_box ();
39 b.scale (magnification_);
40 Molecule q (b,fontify_atom ((Font_metric*) this, m.get_expr ()));
42 return q ;
45 Box
46 Scaled_font_metric::get_char (int i) const
48 Box b = orig_->get_char (i);
49 b.scale (magnification_);
50 return b;
53 Box
54 Scaled_font_metric::text_dimension (String t) const
56 Box b (orig_->text_dimension (t));
58 b.scale (magnification_);
59 return b;
62 int
63 Scaled_font_metric::count () const
65 return orig_->count ();