Fix Swift 5.2 compiler crash (#99)

This commit is contained in:
Tobias Due Munk 2020-02-07 15:09:18 +01:00 committed by GitHub
parent b501e834a8
commit 2d55b33529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 8 deletions

View File

@ -70,14 +70,11 @@ internal extension Font {
}
private func load(fromPath path: String) -> Loaded? {
let url = CFURLCreateWithFileSystemPath(
kCFAllocatorDefault,
path as CFString,
.cfurlposixPathStyle,
false
)
guard let font = url.flatMap(CGDataProvider.init).flatMap(CGFont.init) else {
guard
let url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path as CFString, .cfurlposixPathStyle, false),
let provider = CGDataProvider(url: url),
let font = CGFont(provider)
else {
return nil
}