Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreText note: Client requested name ".SFUI-Regular" #72

Open
nivbp7 opened this issue Feb 16, 2021 · 0 comments
Open

CoreText note: Client requested name ".SFUI-Regular" #72

nivbp7 opened this issue Feb 16, 2021 · 0 comments

Comments

@nivbp7
Copy link

nivbp7 commented Feb 16, 2021

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):

  • OS: iOS14

Smartphone (please complete the following information):

  • Device: iPhone11
  • OS: iOS14.3

Additional context
NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant