diff --git a/rtgui/main.cc b/rtgui/main.cc index 4d4406c37..f27a0f32f 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -338,7 +338,13 @@ int main(int argc, char **argv) if (options.fontFamily != "default") { try { cssForced = Gtk::CssProvider::create(); + //GTK318 + #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 + cssForced->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2px }", options.fontFamily, options.fontSize)); + #else cssForced->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2pt }", options.fontFamily, options.fontSize)); + #endif + //GTK318 Gtk::StyleContext::add_provider_for_screen(screen, cssForced, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } catch (Glib::Error &err) { printf("Error: \"%s\"\n", err.what().c_str()); diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index e96dd3f69..96c1941b5 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -2112,7 +2112,13 @@ void Preferences::switchFontTo(const Glib::ustring &newFontFamily, const int new } try { + //GTK318 + #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 + fontcss->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2px }", newFontFamily, newFontSize)); + #else fontcss->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2pt }", newFontFamily, newFontSize)); + #endif + //GTK318 } catch (Glib::Error &err) { printf("Error: \"%s\"\n", err.what().c_str()); } catch (...) {