From 81964d9ffacd3c7a09a7c146edd4b8d03669e024 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 31 Jul 2017 19:25:58 -0400 Subject: [PATCH] Use preferred font on app start and text resize --- writeas/AppDelegate.swift | 3 --- writeas/ViewController.swift | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/writeas/AppDelegate.swift b/writeas/AppDelegate.swift index f8427aa..ce06e9a 100644 --- a/writeas/AppDelegate.swift +++ b/writeas/AppDelegate.swift @@ -29,13 +29,10 @@ class AppDelegate: NSObject, NSApplicationDelegate { let font = Preferences.getFont() if font == Preferences.PostFont.serif { formatFontSerifItem.state = NSOnState - vc?.setFont(.serif) } else if font == Preferences.PostFont.sans { formatFontSansItem.state = NSOnState - vc?.setFont(.sans) } else if font == Preferences.PostFont.mono { formatFontMonoItem.state = NSOnState - vc?.setFont(.mono) } } diff --git a/writeas/ViewController.swift b/writeas/ViewController.swift index 95f429c..1120fad 100644 --- a/writeas/ViewController.swift +++ b/writeas/ViewController.swift @@ -19,7 +19,7 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe loadDocument() - writerText.font = NSFont(name: "Lora", size: Preferences.getFontSize()) + writerText.font = NSFont(name: Preferences.getFont().typeface, size: Preferences.getFontSize()) writerText.isHorizontallyResizable = false writerText.textContainerInset = NSSize(width: 16, height: 16) writerText.isAutomaticQuoteSubstitutionEnabled = false @@ -139,7 +139,7 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe } else { size -= 1 } - self.writerText.font = NSFont(name: "Lora", size: size) + self.writerText.font = NSFont(name: Preferences.getFont().typeface, size: size) UserDefaults.standard.set(String(Int(size)), forKey: "editor_text_size") configureWindow() }