Bladeren bron

【字体】找不到字体crash修复

lizhe 2 jaren geleden
bovenliggende
commit
6178ac86a8
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 4 4
      PDF Office/PDF Office/Source/Font/NSFont+SFProText.swift

+ 4 - 4
PDF Office/PDF Office/Source/Font/NSFont+SFProText.swift

@@ -7,11 +7,11 @@
 
 import Foundation
 extension NSFont {
-    static func SFProTextRegular(_ size: CGFloat) -> NSFont{
-        return NSFont(name: "SFProText-Regular", size: max(1, size))!
+    static func SFProTextRegular(_ size: CGFloat) -> NSFont? {
+        return NSFont(name: "SFProText-Regular", size: max(1, size))
     }
     
-    static func SFProTextSemibold(_ size: CGFloat) -> NSFont{
-        return NSFont(name: "SFProText-Semibold", size: max(1, size))!
+    static func SFProTextSemibold(_ size: CGFloat) -> NSFont? {
+        return NSFont(name: "SFProText-Semibold", size: max(1, size))
     }
 }