OLD | NEW |
1 /* | 1 /* |
2 font-metric-scheme.cc -- implement Font_metric scheme bindings | 2 font-metric-scheme.cc -- implement Font_metric scheme bindings |
3 | 3 |
4 source file of the GNU LilyPond music typesetter | 4 source file of the GNU LilyPond music typesetter |
5 | 5 |
6 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl> | 6 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl> |
7 */ | 7 */ |
8 | 8 |
9 #include "font-metric.hh" | 9 #include "font-metric.hh" |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 "Given the font metric in @var{font} and the string @var{text}," | 113 "Given the font metric in @var{font} and the string @var{text}," |
114 " compute the extents of that text in that font. The return" | 114 " compute the extents of that text in that font. The return" |
115 " value is a pair of number-pairs.") | 115 " value is a pair of number-pairs.") |
116 { | 116 { |
117 Box b; | 117 Box b; |
118 Modified_font_metric *fm = dynamic_cast<Modified_font_metric *> | 118 Modified_font_metric *fm = dynamic_cast<Modified_font_metric *> |
119 (unsmob_metrics (font)); | 119 (unsmob_metrics (font)); |
120 | 120 |
121 LY_ASSERT_SMOB (Font_metric, font, 1); | 121 LY_ASSERT_SMOB (Font_metric, font, 1); |
122 LY_ASSERT_TYPE (scm_is_string, text, 2); | 122 LY_ASSERT_TYPE (scm_is_string, text, 2); |
123 Stencil stc (fm->text_stencil (ly_scm2string (text))); | 123 Stencil stc (fm->text_stencil (ly_scm2string (text), false)); |
124 return scm_cons (ly_interval2scm (stc.extent (X_AXIS)), | 124 return scm_cons (ly_interval2scm (stc.extent (X_AXIS)), |
125 ly_interval2scm (stc.extent (Y_AXIS))); | 125 ly_interval2scm (stc.extent (Y_AXIS))); |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 /* | 129 /* |
130 TODO: when are non string retvals allowed? | 130 TODO: when are non string retvals allowed? |
131 */ | 131 */ |
132 LY_DEFINE (ly_font_file_name, "ly:font-file-name", | 132 LY_DEFINE (ly_font_file_name, "ly:font-file-name", |
133 1, 0, 0, | 133 1, 0, 0, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 (SCM font), | 170 (SCM font), |
171 "Given the font metric @var{font}, return the" | 171 "Given the font metric @var{font}, return the" |
172 " design size, relative to the current output-scale.") | 172 " design size, relative to the current output-scale.") |
173 { | 173 { |
174 LY_ASSERT_SMOB (Font_metric, font, 1); | 174 LY_ASSERT_SMOB (Font_metric, font, 1); |
175 | 175 |
176 Font_metric *fm = unsmob_metrics (font); | 176 Font_metric *fm = unsmob_metrics (font); |
177 return scm_from_double (fm->design_size ()); | 177 return scm_from_double (fm->design_size ()); |
178 } | 178 } |
179 | 179 |
OLD | NEW |