microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.95k stars 29.53k forks source link

Seeing output running out of sources related to CoreText #98597

Open bpasero opened 4 years ago

bpasero commented 4 years ago
2020-05-26 18:11:47.989 Code - OSS Helper (Renderer)[40222:1396462] 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:].
2020-05-26 18:11:47.989 Code - OSS Helper (Renderer)[40222:1396462] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2020-05-26 18:11:47.995 Code - OSS Helper (Renderer)[40222:1396462] 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:].
2020-05-26 18:11:47.998 Code - OSS Helper (Renderer)[40222:1396462] 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:].
2020-05-26 18:11:47.998 Code - OSS Helper (Renderer)[40222:1396462] 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:].
starpit commented 3 years ago

fwiw, we see this on Electron 10 as well. We only see it when monaco-editor is loaded into our application. Excluding monaco-editor, we never see this message. Perhaps the font monaco-editor uses for its dingbats is causing this?

martonlanga commented 3 years ago

Same using Electron v12 w/ monaco-editor

ysfscream commented 3 years ago

Electron: v11 Monaco-editor: v0.25.2 monaco-editor-webpack-plugin: v4.0.0 MacOS: BigSur 11.4

This problem also occurs in the above environment.

image

BlackHole1 commented 2 years ago

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

https://user-images.githubusercontent.com/8198408/156978338-b21e8b01-2a90-4481-acf0-a2fea3017db9.mp4

In chrome:

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

https://user-images.githubusercontent.com/8198408/156979003-b130602d-032b-4373-9bbc-88954415e174.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 commented 2 years ago

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.