parent
d504a4b1a8
commit
6588a141c2
@ -191,6 +191,8 @@ extension NSAttributedString {
|
|||||||
result.addAttribute(.font, value: baseFont, range: NSRange(location: 0, length: result.length))
|
result.addAttribute(.font, value: baseFont, range: NSRange(location: 0, length: result.length))
|
||||||
|
|
||||||
for (range, styles) in attributeRanges {
|
for (range, styles) in attributeRanges {
|
||||||
|
if range.location >= result.length { continue }
|
||||||
|
|
||||||
let currentFont = result.attribute(.font, at: range.location, effectiveRange: nil) as! Font
|
let currentFont = result.attribute(.font, at: range.location, effectiveRange: nil) as! Font
|
||||||
let currentDescriptor = currentFont.fontDescriptor
|
let currentDescriptor = currentFont.fontDescriptor
|
||||||
var descriptor = currentDescriptor.copy() as! FontDescriptor
|
var descriptor = currentDescriptor.copy() as! FontDescriptor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user