2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2000--2015 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"
25 // update comment --hwn
31 * symbols are at wrong place in font
37 glyph -- text string (TODO: make one large glyph of the Ped symbol, removes need for member_print ())
41 FIXME. Need to use markup.
46 DECLARE_SCHEME_CALLBACK (print, (SCM));
49 MAKE_SCHEME_CALLBACK (Sustain_pedal, print, 1);
51 Sustain_pedal::print (SCM smob)
53 Grob *e = unsmob<Grob> (smob);
56 SCM glyph = e->get_property ("text");
57 if (!scm_is_string (glyph))
58 return mol.smobbed_copy ();
60 string text = ly_scm2string (glyph);
62 for (ssize i = 0; i < text.length (); i++)
64 string idx ("pedal.");
65 if (text.substr (i, 3) == "Ped")
71 idx += string (&text.c_str ()[i], 1);
72 Stencil m = Font_interface::get_default_font (e)->find_by_name (idx);
74 mol.add_at_edge (X_AXIS, RIGHT, m, 0);
77 return mol.smobbed_copy ();