X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ffont-metric.cc;h=a3acc19d88c68fc0be9f9ef527c6d6df67148c43;hb=1402d6d957bee7d47e0bddf4c57dd89912182b26;hp=dd1d6245ca2209ced80154bd0492d3972081a524;hpb=eea589c2d7bee6ab38bc611eb205d4c74e2011f7;p=lilypond.git diff --git a/lily/font-metric.cc b/lily/font-metric.cc index dd1d6245ca..a3acc19d88 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -1,11 +1,11 @@ -/* +/* font-metric.cc -- implement Font_metric - + source file of the GNU LilyPond music typesetter - - (c) 1999--2004 Han-Wen Nienhuys - Mats Bengtsson (the ugly TeX parsing in text_dimension) + (c) 1999--2005 Han-Wen Nienhuys + + Mats Bengtsson (the ugly TeX parsing in text_dimension) */ #include "font-metric.hh" @@ -28,24 +28,22 @@ Font_metric::design_size () const return 1.0 * point_constant; } - Stencil Font_metric::find_by_name (String s) const { - s.substitute_char ('-', "M"); + s.substitute ('-', 'M'); int idx = name_to_index (s); Box b; - + SCM expr = SCM_EOL; if (idx >= 0) { expr = scm_list_3 (ly_symbol2scm ("named-glyph"), self_scm (), - scm_makfrom0str (s.to_str0 ()) - ); + scm_makfrom0str (s.to_str0 ())); b = get_indexed_char (idx); } - + Stencil q (b, expr); return q; } @@ -61,7 +59,6 @@ Font_metric::Font_metric (Font_metric const &) { } - Font_metric::~Font_metric () { } @@ -72,13 +69,13 @@ Font_metric::count () const return 0; } -Box +Box Font_metric::get_ascii_char (int) const { return Box (Interval (0, 0), Interval (0, 0)); } -Box +Box Font_metric::get_indexed_char (int k) const { return get_ascii_char (k); @@ -104,7 +101,7 @@ Font_metric::derived_mark () const SCM Font_metric::mark_smob (SCM s) { - Font_metric *m = (Font_metric*) SCM_CELL_WORD_1 (s); + Font_metric *m = (Font_metric *) SCM_CELL_WORD_1 (s); m->derived_mark (); return m->description_; } @@ -121,14 +118,11 @@ Font_metric::print_smob (SCM s, SCM port, scm_print_state *) return 1; } - - IMPLEMENT_SMOBS (Font_metric); IMPLEMENT_DEFAULT_EQUAL_P (Font_metric); IMPLEMENT_TYPE_P (Font_metric, "ly:font-metric?"); - -SCM +SCM Font_metric::font_file_name () const { return scm_car (description_); @@ -143,7 +137,6 @@ Font_metric::font_name () const #include "afm.hh" - int Font_metric::index_to_ascii (int i) const { @@ -174,7 +167,6 @@ Font_metric::get_indexed_char_stencil (int code) const return Stencil (b, at); } - Offset Font_metric::attachment_point (String) const { @@ -193,7 +185,7 @@ Font_metric::text_stencil (String str) const SCM lst = scm_list_3 (ly_symbol2scm ("text"), this->self_scm (), scm_makfrom0str (str.to_str0 ())); - + Box b = text_dimension (str); return Stencil (b, lst); } @@ -201,6 +193,6 @@ Font_metric::text_stencil (String str) const Box Font_metric::text_dimension (String) const { - return Box (Interval (0,0), Interval (0,0)); + return Box (Interval (0, 0), Interval (0, 0)); }