[meld/windows-font-fixes: 4/7] settings: Special case default monospace font on Windows (#453)



commit 27005f67d28e742f476daa57b6e52df669dcc753
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Apr 25 08:48:37 2020 +1000

    settings: Special case default monospace font on Windows (#453)
    
    We were getting the desktop default via the desktop schema settings,
    which aren't platform-specific. While there are definitely options for
    correctly getting the Windows default monospace font, just setting it
    to Consolas is going to work well for the vast majority of users.

 meld/settings.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/meld/settings.py b/meld/settings.py
index d68bf00b..a240a8e3 100644
--- a/meld/settings.py
+++ b/meld/settings.py
@@ -13,6 +13,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import sys
+
 from gi.repository import Gio, GObject, GtkSource, Pango
 
 import meld.conf
@@ -69,7 +71,11 @@ class MeldSettings(GObject.GObject):
 
     def _current_font_from_gsetting(self, *args):
         if settings.get_boolean('use-system-font'):
-            font_string = interface_settings.get_string('monospace-font-name')
+            if sys.platform == 'win32':
+                font_string = 'Consolas 11'
+            else:
+                font_string = interface_settings.get_string(
+                    'monospace-font-name')
         else:
             font_string = settings.get_string('custom-font')
         return Pango.FontDescription(font_string)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]