You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set a strikethrough on text, to indicate that this item is complete.
I am using this code snippet to add the strikethrough let struckText = NSAttributedString(string: todoText, attributes: [NSAttributedString.Key.nantesLabelStrikeOut: true])
When the label is rendered the following message appears in the console: CoreText note: Client requested name ".SFUI-Regular", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[UIFont systemFontOfSize:]. CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
When setting the CTFontLogSystemFontNameRequest breakpoint, this is the first line in the stack trace.
method - drawStrike(frame: CTFrame, inRect: CGRect, context: CGContext)
file - Drawing.swift let font = CTFontCreateWithName(myFont.fontName as CFString, myFont.pointSize, nil)
Describe the bug
I'm trying to set a strikethrough on text, to indicate that this item is complete.
I am using this code snippet to add the strikethrough
let struckText = NSAttributedString(string: todoText, attributes: [NSAttributedString.Key.nantesLabelStrikeOut: true])
When the label is rendered the following message appears in the console:
CoreText note: Client requested name ".SFUI-Regular", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[UIFont systemFontOfSize:]. CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
When setting the CTFontLogSystemFontNameRequest breakpoint, this is the first line in the stack trace.
method - drawStrike(frame: CTFrame, inRect: CGRect, context: CGContext)
file - Drawing.swift
let font = CTFontCreateWithName(myFont.fontName as CFString, myFont.pointSize, nil)
To Reproduce
Steps to reproduce the behavior:
let label: NantesLabel = .init(frame: CGRect(x: 20, y: 100, width: view.frame.width, height: 100)) let attributedText = NSMutableAttributedString(string: text, attributes: [NSAttributedString.Key.backgroundColor: UIColor.lightGray]) let struckText = NSAttributedString(string: text, attributes: [NSAttributedString.Key.nantesLabelStrikeOut: true]) attributedText.append(struckText) label.attributedText = attributedText view.addSubview(label)
Expected behavior
The font passed in with the attributes or the system font should be used
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
NA
The text was updated successfully, but these errors were encountered: