JDK-8244621 : [macos10.15] Garbled FX printing plus CoreText warnings on Catalina when building with Xcode 11
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8u291,11.0.11-oracle,15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x_10.15
  • Submitted: 2020-05-07
  • Updated: 2021-03-01
  • Resolved: 2020-06-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 15 JDK 8 Other
11.0.10Fixed 13.0.6Fixed 15 b27Fixed 8u291Fixed openjdk8u292Fixed
Related Reports
Relates :  
Description
To reproduce this do the following on macOS 10.15 Catalina:

1. Build the jdk with Xcode 11 and MacOSX SDK 10.15.

2. Run any Java program that draws text, for example, the attached Simple.java program:

$ java -version
java version "15-internal" 2020-09-15
Java(TM) SE Runtime Environment (build 15-internal+0-2020-05-07-1853296.kcr...)
Java HotSpot(TM) 64-Bit Server VM (build 15-internal+0-2020-05-07-1853296.kcr..., mixed mode, sharing)

$ java Simple
2020-05-07 13:18:45.444 java[16424:4942077] 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-05-07 13:18:45.444 java[16424:4942077] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2020-05-07 13:18:45.445 java[16424:4942077] CoreText note: Client requested name ".SFNS-Bold", 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-07 13:18:45.446 java[16424:4942077] CoreText note: Client requested name ".SFNSMono-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-07 13:18:45.452 java[16424:4942077] CoreText note: Client requested name ".SFNSMono-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-07 13:18:45.453 java[16424:4942077] CoreText note: Client requested name ".SFNSMono-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-07 13:18:45.458 java[16424:4942077] 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-05-07 13:18:45.458 java[16424:4942077] CoreText note: Client requested name ".SFNS-Bold", 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
Fix request (8u) 8 is also affected by this when built with xcode11+, libawt only change, applies cleanly after file path fix, tests : jdk:tier1, jdk:tier2 and some internal testing. The issue can be reproduced without the fix and can't be reproduced with it. I've built it also with old xcode 4.x to make sure the build is not broken. Even tho the upstream doesn't support xcode11+, some downstream vendors can build with newer xcodes. It would be good to have this fix and won't harm those using old Xcode.
24-11-2020

Fix request (13u) 13 is also affected by this when built with xcode11+, libawt only change, applies cleanly, tests : jdk:tier1, jdk:tier2
23-11-2020

Fix request (11u) 11 is also affected by this when built with xcode11+, libawt only change, applies cleanly, tests : jdk:tier1, jdk:tier2
23-11-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/6628a50b6dcd User: psadhukhan Date: 2020-06-10 07:15:15 +0000
10-06-2020

URL: https://hg.openjdk.java.net/jdk/client/rev/6628a50b6dcd User: prr Date: 2020-06-05 23:38:34 +0000
05-06-2020

Raising to P3 since it leads to a functional regression in FX printing. Also the warnings will be quite annoying for developers.
15-05-2020

We faced something similar in JavaFX itself. See JDK-8234916.
14-05-2020

As suspected, FX printing is garbled when running a JDK built with Xcode11. It's fine when running a JDK built with Xcode 10. See the attached screen shots.
14-05-2020

I don't have access to a printer at the moment. I ran Font2D test, selected ".SF NS Mono" and it looks fine (not drawn as Times).
14-05-2020

The message is logged because the macOS implementation initialises all fonts - inefficient but it does - even if they aren't used. These . * fonts are all about FX printing :- https://bugs.openjdk.java.net/browse/JDK-8089573 GetFilteredFonts() in AWTFont.m excludes most fonts beginning with "." from what we report as available, but these are used for the FX "System" font so need to be available. Quite possibly the way to see this causing breakage is to try a small FX printing app - one of the samples - that prints text using the system font. Since the glyph mappings for the San Fransciso and TImes fonts don't look the same I expect garbled printing. Also just try to run Font2DTest and select ".SF NS Regular" or however it displays and see if that is actually showing Times.
08-05-2020