Skip to content

Commit 7eddd37

Browse files
committed
Fix possible issues were font is not available.
1 parent 3d0c2e8 commit 7eddd37

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Aztec/Classes/TextKit/LayoutManager.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,11 @@ private extension LayoutManager {
317317
traits.remove(.traitBold)
318318
traits.remove(.traitItalic)
319319

320-
let descriptor = font.fontDescriptor.withSymbolicTraits(traits)
321-
return UIFont(descriptor: descriptor!, size: font.pointSize)
320+
if let descriptor = font.fontDescriptor.withSymbolicTraits(traits) {
321+
return UIFont(descriptor: descriptor, size: font.pointSize)
322+
} else {
323+
// Don't touch the font if we cannot remove the symbolic traits.
324+
return font
325+
}
322326
}
323327
}

0 commit comments

Comments
 (0)