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 ".NewYork-Regular" #586

Open
erickzhao opened this issue Mar 3, 2021 · 2 comments
Open

CoreText note: Client requested name ".NewYork-Regular" #586

erickzhao opened this issue Mar 3, 2021 · 2 comments
Labels
🌿 upstream Issues related to Upstream dependencies

Comments

@erickzhao
Copy link
Member

When running Fiddle locally, one encounters the following log messages:

2021-03-02 16:33:37.316 Electron Helper (Renderer)[46761:3074059] CoreText note: Client requested name ".NewYork-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2021-03-02 16:33:37.316 Electron Helper (Renderer)[46761:3074059] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2021-03-02 16:33:37.321 Electron Helper (Renderer)[46761:3074059] CoreText note: Client requested name ".NewYork-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].

Apparently, this is due to an upstream issue with Monaco.

ref microsoft/vscode#98597

@erickzhao erickzhao added the 🌿 upstream Issues related to Upstream dependencies label Mar 3, 2021
@BlackHole1
Copy link
Member

BlackHole1 commented Mar 7, 2022

I have spent some time investigating this issue. The problem was found to be caused by chromium.

Reproduction code:

@font-face {
  font-family: system;
  font-style: normal;
  font-weight: 300;
  src: local(".NewYork-Regular");
}
h1 {
  font-family: "system";
}

From Xcode 11 onwards, this warning will be raised.
This problem is still present in the latest Chrome.

In electron-fiddle:

gist: https://gist.github.com/BlackHole1/ca89d41a5469b0d80be9362c6b62487b

1.mp4

In chrome:

gist: https://gist.github.com/BlackHole1/91a22621ac4f912d85235850d2eafdc6

2.mp4

crbug link: https://bugs.chromium.org/p/chromium/issues/detail?id=1131559


Causes of this problem:

This warning is triggered as soon as CTFontCreateWithName or [UIFont fontWithName:fontName size:fontSize] is used.

@BlackHole1
Copy link
Member

At the moment I see that the chromium team doesn't know how to reproduce the problem and I will go and talk to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌿 upstream Issues related to Upstream dependencies
Projects
None yet
Development

No branches or pull requests

2 participants