diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-19 11:18:37 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-19 11:18:44 -0400 |
commit | 01df705f701a115c017ca23ee21ff64d8d49bfe2 (patch) | |
tree | c4adbb49cc283f0852c156b01f1e63d6c24a7060 /gtk2_ardour/utils.cc | |
parent | 280fc81e05f885c1259ec6513297507b9e6c87b2 (diff) |
change the way font specifications are used in UI config files
If no font family is specified, enforce use of Sans to match GTK behaviour (which we inadvertently relied on, it appears)
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index facbe92db5..104005e21a 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -207,6 +207,18 @@ xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h) } Pango::FontDescription +sanitized_font (std::string const& name) +{ + Pango::FontDescription fd (name); + + if (fd.get_family().empty()) { + fd.set_family ("Sans"); + } + + return fd; +} + +Pango::FontDescription get_font_for_style (string widgetname) { Gtk::Window window (WINDOW_TOPLEVEL); |