Merge branch 'bugfix/attrib_fixfont' into 'release/7_7_0'

font fix for 3.0

See merge request BPHV_MIPS/mvm_core_ui!462
This commit is contained in:
Pfeil, Scott Robert 2020-05-22 16:35:57 -04:00
commit 58a174fd91
2 changed files with 13 additions and 3 deletions

View File

@ -402,11 +402,11 @@ public typealias ActionBlock = () -> ()
attributedString.insert(mutableString, at: imageAtt.location)
case let fontAtt as LabelAttributeFontModel:
if let fontStyle = fontAtt.style?.rawValue {
let styles = MFStyler.styleGetAttributedString("0", withStyle: fontStyle)
if let fontStyle = fontAtt.style {
attributedString.removeAttribute(.font, range: range)
attributedString.removeAttribute(.foregroundColor, range: range)
attributedString.addAttributes(styles.attributes(at: 0, effectiveRange: nil), range: range)
attributedString.addAttribute(.font, value: fontStyle.getFont(), range: range)
attributedString.addAttribute(.foregroundColor, value: fontStyle.color(), range: range)
} else {
let fontSize = fontAtt.size
var font: UIFont?

View File

@ -81,6 +81,16 @@ open class Styler {
}
}
public func color() -> UIColor {
switch self {
case .B3:
return .mvmCoolGray6
default:
return .mvmBlack
}
}
/// Determines if the selected font case is bold or regular.
public func isBold() -> Bool {