updates plug with all sorts of awesome improvements
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import CoreText
|
||||
import Foundation
|
||||
|
||||
/// Registers the bundled OpenDyslexic and OpenDyslexic Mono faces for this process.
|
||||
/// Registers the bundled IBM Plex faces for this process. CoreText reads WOFF2 directly.
|
||||
public enum FontRegistry {
|
||||
public static let resourceBundleName = "Plak_PlakUI.bundle"
|
||||
|
||||
@@ -38,7 +38,7 @@ public enum FontRegistry {
|
||||
registered = names
|
||||
return names
|
||||
}
|
||||
for url in files where ["otf", "ttf"].contains(url.pathExtension.lowercased()) {
|
||||
for url in files where ["woff2", "woff", "ttf", "otf"].contains(url.pathExtension.lowercased()) {
|
||||
var error: Unmanaged<CFError>?
|
||||
let ok = CTFontManagerRegisterFontsForURL(url as CFURL, .process, &error)
|
||||
let already = (error?.takeRetainedValue()).map { CFErrorGetCode($0) == CTFontManagerError.alreadyRegistered.rawValue } ?? false
|
||||
|
||||
Reference in New Issue
Block a user