update to look for a font with a found style to use our FontLabelAttribute
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
e46017f315
commit
0b73207bd6
@ -39,6 +39,11 @@ public extension NSAttributedString {
|
||||
|
||||
static func createAttributeModelFor(key: NSAttributedString.Key, range: NSRange, value: Any) -> (any LabelAttributeModel)? {
|
||||
guard let value = value as? AnyHashable else { return nil }
|
||||
return AnyAttribute(location: range.location, length: range.length, key: key, value: value)
|
||||
|
||||
guard let font = value as? UIFont, let style = TypographicalStyle.style(for: font.fontName, size: font.pointSize), key == .font
|
||||
else {
|
||||
return AnyAttribute(location: range.location, length: range.length, key: key, value: value)
|
||||
}
|
||||
return FontLabelAttribute(location: range.location, length: range.length, style: style)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user