Allow using ArdourSans as optional default font
authorRobin Gareus <robin@gareus.org>
Wed, 4 Dec 2019 21:59:51 +0000 (22:59 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 4 Dec 2019 21:59:51 +0000 (22:59 +0100)
gtk2_ardour/clearlooks.rc.in
gtk2_ardour/ui_config_vars.h
gtk2_ardour/utils.cc
gtk2_ardour/wscript

index cc8c7cd9abac4ecefc6a59f3de886b0827b1bd46..e2d25acb65d135c7f77d41c6bafe5559a2d29356 100644 (file)
@@ -282,12 +282,12 @@ style "status_bar_box"
 
 style "very_small_text"
 {
-       font_name = "@FONT_SMALLER@"
+       font_name = "@FONTFAMILY@ @FONT_SMALLER@"
 }
 
 style "small_text"
 {
-       font_name = "@FONT_SMALL@"
+       font_name = "@FONTFAMILY@ @FONT_SMALL@"
 }
 
 style "small_clock"
@@ -297,22 +297,22 @@ style "small_clock"
 
 style "small_italic_text"
 {
-       font_name = "italic @FONT_SMALL@"
+       font_name = "@FONTFAMILY@ italic @FONT_SMALL@"
 }
 
 style "small_bold_text"
 {
-       font_name = "bold @FONT_SMALL@"
+       font_name = "@FONTFAMILY@ bold @FONT_SMALL@"
 }
 
 style "medium_bold_text"
 {
-       font_name = "bold @FONT_NORMAL@"
+       font_name = "@FONTFAMILY@ bold @FONT_NORMAL@"
 }
 
 style "medium_text"
 {
-       font_name = "@FONT_NORMAL@"
+       font_name = "@FONTFAMILY@ @FONT_NORMAL@"
 }
 
 style "medium_monospace_text"
@@ -329,12 +329,12 @@ style "red_medium_text" = "medium_text"
 
 style "large_bold_text"
 {
-       font_name = "bold @FONT_LARGE@"
+       font_name = "@FONTFAMILY@ bold @FONT_LARGE@"
 }
 
 style "big_text"
 {
-        font_name = "@FONT_BIG@"
+        font_name = "@FONTFAMILY@ @FONT_BIG@"
 }
 
 style "bigger_clock"
@@ -344,7 +344,7 @@ style "bigger_clock"
 
 style "larger_text"
 {
-       font_name = "@FONT_LARGE@"
+       font_name = "@FONTFAMILY@ @FONT_LARGE@"
 }
 
 style "massive_clock"
@@ -354,7 +354,7 @@ style "massive_clock"
 
 style "big_bold_text"
 {
-       font_name = "bold @FONT_LARGER@"
+       font_name = "@FONTFAMILY@ bold @FONT_LARGER@"
 }
 
 style "plugin_name_text" = "big_bold_text"
index 9b70deb026ef6f75cd88f0be4043a840cc35f482..5f145de7055d7ceac6fcb1359b2fdf2e50102195 100644 (file)
@@ -21,6 +21,7 @@
 
 UI_CONFIG_VARIABLE (std::string, icon_set, "icon-set", "default")
 UI_CONFIG_VARIABLE (std::string, ui_rc_file, "ui-rc-file", "clearlooks.rc")
+UI_CONFIG_VARIABLE (std::string, ui_font_family, "ui-font-family", "Sans")
 UI_CONFIG_VARIABLE (std::string, color_file, "color-file", "dark")
 UI_CONFIG_VARIABLE (bool, flat_buttons, "flat-buttons", false)
 UI_CONFIG_VARIABLE (bool, boxy_buttons, "boxy-buttons", false)
index 7489b2e08b89ecbd34beb6750d024def23f78556..25196a62dd927d592c6089814a87c6b4465611f4 100644 (file)
@@ -277,7 +277,8 @@ ARDOUR_UI_UTILS::sanitized_font (std::string const& name)
        Pango::FontDescription fd (name);
 
        if (fd.get_family().empty()) {
-               fd.set_family ("Sans");
+               /* default: "Sans" or "ArdourSans" */
+               fd.set_family (UIConfiguration::instance ().get_ui_font_family ());
        }
 
        return fd;
index c63524d914ad88a87ac5f43f07b721648b1febbc..a2d75c3c68b741d44e62ef8f84470284a1fc0c86 100644 (file)
@@ -822,6 +822,7 @@ def build(bld):
         key = font_sym
         font_subst_dict[key] = text
 
+    font_subst_dict['FONTFAMILY'] = ''
     # RC file
 
     obj              = bld(features = 'subst')
@@ -830,6 +831,14 @@ def build(bld):
     obj.install_path = bld.env['CONFDIR']
     set_subst_dict(obj, font_subst_dict)
 
+    font_subst_dict['FONTFAMILY'] = 'ArdourSans'
+
+    obj              = bld(features = 'subst')
+    obj.source       = [ 'clearlooks.rc.in' ]
+    obj.target       = 'clearlooks.ardoursans.rc'
+    obj.install_path = bld.env['CONFDIR']
+    set_subst_dict(obj, font_subst_dict)
+
     obj              = bld(features = 'subst')
     obj.source       = [ 'default_ui_config.in' ]
     obj.target       = 'default_ui_config'