X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscaled-font-metric.cc;h=8583887b5855aa225ad2ae78ada741f371b15531;hb=b209affed3653e31c4078557342ba392209dff55;hp=6b9be2b972793a49bc5d732f291a5e0ec3f72644;hpb=94189ec2b8da6d7e89dc619c646a927adead9b19;p=lilypond.git diff --git a/lily/scaled-font-metric.cc b/lily/scaled-font-metric.cc index 6b9be2b972..8583887b58 100644 --- a/lily/scaled-font-metric.cc +++ b/lily/scaled-font-metric.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2001 Han-Wen Nienhuys + (c) 1999--2003 Han-Wen Nienhuys */ @@ -14,12 +14,14 @@ 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 @@ -32,10 +34,10 @@ Scaled_font_metric::make_scaled_font_metric (Font_metric*m, Real s) Molecule Scaled_font_metric::find_by_name (String s) const { - Molecule m = orig_l_->find_by_name (s); + Molecule 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_); + Molecule q (b,fontify_atom ((Font_metric*) this, m.get_expr ())); return q ; } @@ -43,16 +45,22 @@ Scaled_font_metric::find_by_name (String s) const Box Scaled_font_metric::get_char (int i) const { - Box b = orig_l_->get_char (i); - b.scale (magnification_f_); + Box b = orig_->get_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 (); +}