diff --git a/VDS/Components/Label/Attributes/LabelAttributeModel.swift b/VDS/Components/Label/Attributes/LabelAttributeModel.swift index 321e2074..7196a346 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeModel.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeModel.swift @@ -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) } }