2 font-interface.cc -- implement Font_interface
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "font-interface.hh"
11 #include "all-font-metrics.hh"
12 #include "output-def.hh"
16 /* todo: split up this func, reuse in text_item? */
18 Font_interface::get_default_font (Grob
*me
)
20 Font_metric
*fm
= unsmob_metrics (me
->get_property ("font"));
23 SCM chain
= music_font_alist_chain (me
);
25 fm
= select_font (me
->layout (), chain
);
26 me
->set_property ("font", fm
->self_scm ());
33 Font_interface::music_font_alist_chain (Grob
*g
)
36 = g
->layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
37 if (defaults
== SCM_UNDEFINED
)
39 return g
->get_property_alist_chain (defaults
);
43 Font_interface::text_font_alist_chain (Grob
*g
)
46 = g
->layout ()->lookup_variable (ly_symbol2scm ("text-font-defaults"));
47 if (defaults
== SCM_UNDEFINED
)
49 return g
->get_property_alist_chain (defaults
);
52 ADD_INTERFACE (Font_interface
,
53 "Any symbol that is typeset through fixed sets of glyphs,"