Skip to content

Commit 2d55b33

Browse files
authored
Fix Swift 5.2 compiler crash (#99)
1 parent b501e83 commit 2d55b33

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

Sources/Splash/Theming/Font.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,11 @@ internal extension Font {
7070
}
7171

7272
private func load(fromPath path: String) -> Loaded? {
73-
let url = CFURLCreateWithFileSystemPath(
74-
kCFAllocatorDefault,
75-
path as CFString,
76-
.cfurlposixPathStyle,
77-
false
78-
)
79-
80-
guard let font = url.flatMap(CGDataProvider.init).flatMap(CGFont.init) else {
73+
guard
74+
let url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path as CFString, .cfurlposixPathStyle, false),
75+
let provider = CGDataProvider(url: url),
76+
let font = CGFont(provider)
77+
else {
8178
return nil
8279
}
8380

0 commit comments

Comments
 (0)