Rely on the system’s default monospaced font rather than Menlo

Furthermore, if the user changes to the default monospaced font then we do not store its name in settings (given that it’s default).
This commit is contained in:
Allan Odgaard
2016-07-05 12:03:52 +02:00
parent 7e69201513
commit 0bb275b4f0
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,4 @@
theme = '766026CB-703D-4610-B070-8DE07D967C5F'
fontName = 'Menlo-Regular'
fontSize = 12
encoding = "UTF-8"

View File

@@ -283,9 +283,11 @@ private:
- (void)changeFont:(id)sender
{
if(NSFont* newFont = [sender convertFont:_textView.font ?: [NSFont userFixedPitchFontOfSize:0]])
NSFont* defaultFont = [NSFont userFixedPitchFontOfSize:0];
if(NSFont* newFont = [sender convertFont:_textView.font ?: defaultFont])
{
settings_t::set(kSettingsFontNameKey, to_s([newFont fontName]));
std::string fontName = [newFont.fontName isEqualToString:defaultFont.fontName] ? NULL_STR : to_s(newFont.fontName);
settings_t::set(kSettingsFontNameKey, fontName);
settings_t::set(kSettingsFontSizeKey, [newFont pointSize]);
_textView.font = newFont;
[self updateGutterViewFont:self];