X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpango-font.cc;h=14ceadf438a530c5e851e5754164b1ee1918d218;hb=1a1d2e078682968b5a0a98ecbe2388b93fa2aa44;hp=f6456dd826a2a6e9280229e392aaadb34a4978d4;hpb=5ea982187f9aebfe588225813be14c48020452f3;p=lilypond.git diff --git a/lily/pango-font.cc b/lily/pango-font.cc index f6456dd826..14ceadf438 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2004--2008 Han-Wen Nienhuys + (c) 2004--2009 Han-Wen Nienhuys */ #define PANGO_ENABLE_BACKEND // ugh, why necessary? @@ -285,19 +285,20 @@ Pango_font::physical_font_tab () const } Stencil -Pango_font::word_stencil (string str) const +Pango_font::word_stencil (string str, bool feta) const { - return text_stencil (str, true); + return text_stencil (str, feta, true); } Stencil -Pango_font::text_stencil (string str) const +Pango_font::text_stencil (string str, bool feta) const { - return text_stencil (str, false); + return text_stencil (str, feta, false); } Stencil Pango_font::text_stencil (string str, + bool feta, bool tight) const { GList *items @@ -346,10 +347,27 @@ Pango_font::text_stencil (string str, dest.add_stencil (item_stencil); } - // UGH. Should have flags per output format signifying supported - // options. string name = get_output_backend_name (); - if (name != "ps" && name != "eps") + string output_mod = "scm output-" + name; + SCM mod = scm_c_resolve_module (output_mod.c_str ()); + + bool has_utf8_string = false; + + if (ly_is_module (mod)) + { + SCM utf8_string = ly_module_lookup (mod, ly_symbol2scm ("utf-8-string")); + if (utf8_string != SCM_BOOL_F) + has_utf8_string = true; + } + + /* + The SVG backend only uses utf-8-string for the non-music + fonts, hence the check here. --pmccarty + + TODO: use a program option (-dmusic-strings-to-paths) here + instead that is enabled only when -dbackend=svg. + */ + if ((name == "svg" && !feta) || (name != "svg" && has_utf8_string)) { // For Pango based backends, we take a shortcut. SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"),