JDK-8255097 : [macos 10.15] System fonts are not loaded properly | OpenJDK build 13.0.2+8
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 13
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x_10.15
  • CPU: x86_64
  • Submitted: 2020-10-16
  • Updated: 2020-10-21
  • Resolved: 2020-10-21
Description
ADDITIONAL SYSTEM INFORMATION :
System:
MacOS Catalina 10.15

Java:
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)


A DESCRIPTION OF THE PROBLEM :
Java is unable to load system fonts properly. Even by overriding the 

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Given a system with the specified requirements, install Java 13.0.2
2) Create a simple JavaFX application that is supposed to display some text, so add a single Label with the following text: "Hello, World". Do not change the font programmatically, use the default system fonts.
3) Start the application.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A window appears, showing the text "Hello, World"
ACTUAL -
The text appears garbled and unreadable.

Adding the following CSS rule (which on other systems successfully overrides the default fonts) has no effect on MacOS 10.15:
.root {
    -fx-font-family: "Arial, open-sans";
}


The following text is printed in the system logs (regardless of the CSS rule):

2020-10-12T20:18:08.436+0300 [ERROR] [system.err] 2020-10-12 20:18:08.437 java[55488:13188237] CoreText note: Client requested name ".SFNS-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-10-12T20:18:08.437+0300 [ERROR] [system.err] 2020-10-12 20:18:08.437 java[55488:13188237] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2020-10-12T20:18:08.462+0300 [ERROR] [system.err] 2020-10-12 20:18:08.462 java[55488:13188237] CoreText note: Client requested name ".SFNS-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-10-12T20:18:08.717+0300 [ERROR] [system.err] 2020-10-12 20:18:08.718 java[55488:13188272] CoreText note: Client requested name ".SFNS-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-10-12T20:18:08.749+0300 [ERROR] [system.err] 2020-10-12 20:18:08.750 java[55488:13188272] CoreText note: Client requested name ".SFNS-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-10-12T20:18:08.756+0300 [ERROR] [system.err] 2020-10-12 20:18:08.756 java[55488:13188272] CoreText note: Client requested name ".SFNS-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:].



Comments
Duplicate of JDK-8244621
21-10-2020