2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2000--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
21 #include "font-interface.hh"
23 // update comment --hwn
29 * symbols are at wrong place in font
35 glyph -- text string (TODO: make one large glyph of the Ped symbol, removes need for member_print ())
39 FIXME. Need to use markup.
44 DECLARE_SCHEME_CALLBACK (print
, (SCM
));
47 MAKE_SCHEME_CALLBACK (Sustain_pedal
, print
, 1);
49 Sustain_pedal::print (SCM smob
)
51 Grob
*e
= unsmob_grob (smob
);
54 SCM glyph
= e
->get_property ("text");
55 if (!scm_is_string (glyph
))
56 return mol
.smobbed_copy ();
58 string text
= ly_scm2string (glyph
);
60 for (ssize i
= 0; i
< text
.length (); i
++)
62 string
idx ("pedal.");
63 if (text
.substr (i
, 3) == "Ped")
69 idx
+= string (&text
.c_str ()[i
], 1);
70 Stencil m
= Font_interface::get_default_font (e
)->find_by_name (idx
);
72 mol
.add_at_edge (X_AXIS
, RIGHT
, m
, 0);
75 return mol
.smobbed_copy ();