X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ffont-interface.cc;h=9bd109545839de586198784106bd333585c0cf9e;hb=9c3ecc7d6e596e8151a58ce7ed0dd9e1b0802d1e;hp=d96529383a607058bd59ca2783cb40629d67b72b;hpb=c659cb200486c2f908703696a1b2873e78c8160a;p=lilypond.git diff --git a/lily/font-interface.cc b/lily/font-interface.cc index d96529383a..9bd1095458 100644 --- a/lily/font-interface.cc +++ b/lily/font-interface.cc @@ -1,9 +1,9 @@ /* - font-interface.cc -- implement Font_interface - + font-interface.cc -- implement Font_interface + source file of the GNU LilyPond music typesetter - (c) 2000--2004 Han-Wen Nienhuys + (c) 2000--2009 Han-Wen Nienhuys */ #include "font-interface.hh" @@ -21,30 +21,21 @@ Font_interface::get_default_font (Grob *me) if (!fm) { SCM chain = music_font_alist_chain (me); - - fm = select_font (me->get_layout (), chain); + + fm = select_font (me->layout (), chain); me->set_property ("font", fm->self_scm ()); } - - return fm; -} -LY_DEFINE (ly_font_interface_get_default_font, "ly:get-default-font", - 1 , 0, 0, (SCM grob), - "Return the default font for grob @var{gr}.") -{ - Grob *gr = unsmob_grob (grob); - SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob"); - - return Font_interface::get_default_font (gr)->self_scm (); + return fm; } - SCM Font_interface::music_font_alist_chain (Grob *g) { SCM defaults - = g->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults")); + = g->layout ()->lookup_variable (ly_symbol2scm ("font-defaults")); + if (defaults == SCM_UNDEFINED) + defaults = SCM_EOL; return g->get_property_alist_chain (defaults); } @@ -52,12 +43,22 @@ SCM Font_interface::text_font_alist_chain (Grob *g) { SCM defaults - = g->get_layout ()->lookup_variable (ly_symbol2scm ("text-font-defaults")); + = g->layout ()->lookup_variable (ly_symbol2scm ("text-font-defaults")); + if (defaults == SCM_UNDEFINED) + defaults = SCM_EOL; return g->get_property_alist_chain (defaults); } -ADD_INTERFACE (Font_interface, "font-interface", - "Any symbol that is typeset through fixed sets of glyphs, " - " (ie. fonts)", - "font-magnification font font-series font-shape " - "font-family font-encoding font-name font-size"); +ADD_INTERFACE (Font_interface, + "Any symbol that is typeset through fixed sets of glyphs," + " (i.e., fonts).", + + /* properties */ + "font " + "font-encoding " + "font-family " + "font-name " + "font-series " + "font-shape " + "font-size " + );