forked from shadowfacts/Tusker
Account for bidi text in combined display/username label
This commit is contained in:
parent
12bab71b17
commit
01cf597b5d
|
@ -30,7 +30,9 @@ class AccountDisplayAndUserNameLabel: EmojiLabel {
|
|||
|
||||
private func makeAttributedText(state: State) -> NSAttributedString {
|
||||
let s = NSMutableAttributedString()
|
||||
s.append(NSAttributedString(string: state.displayName, attributes: [
|
||||
// U+2068 FIRST-STRONG ISOLATE and U+2069 POP DIRECTIONAL ISOLATE
|
||||
// to prevent bidi text in the display name influencing the username
|
||||
s.append(NSAttributedString(string: "\u{2068}\(state.displayName)\u{2069}", attributes: [
|
||||
.font: UIFont(descriptor: baseFont.addingAttributes([
|
||||
.traits: [
|
||||
UIFontDescriptor.TraitKey.weight: UIFont.Weight.semibold.rawValue,
|
||||
|
|
Loading…
Reference in New Issue