JDK-8236689 : macOS 10.15 Catalina: LCD text renders badly
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: jfx11,jfx13,8u221,jfx14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x_10.15
  • CPU: x86
  • Submitted: 2019-12-28
  • Updated: 2024-07-18
  • Resolved: 2021-10-20
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.
Other
jfx17.0.13Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
OS: macOS 10.15.2
Java: OpenJDK 11.0.5 (AdaptOpenJDK), OpenJDK 13.0.1 (AdoptOpenJDK), OpenJDK 14 EA Build 28 (2019/12/18)
JavaFX: OpenJFX 11.0.2, OpenJFX 13.0.1, OpenJFX 14-ea+6
Display: Dell 24" 1920x1200, MacBook Air (2013) 1440x900

Same problem exists in all combinations.

A DESCRIPTION OF THE PROBLEM :
Since updating to macOS Catalina the text rendering is broken in all JavaFX contrals which render text (labels, text areas, buttons, menu items etc.). This behavior is new since macOS 10.15 Catalina, it worked perfectly in macOS 10.14.x and before.
The rendered text is still readable, but looks very blurred. And it looks like vertical pixel lines are completely missing in the displayed text.

This error occurs when using a non-Retina (HiDPI) display, e.g. a MacBook Air with the 1440x900 resolution or an external typical FullHD display (e.g. 24" 1920x1080). Only when using a HiDPI / Retina display, then the rendered text looks fine. Unfortunately many / most people are still using non-Retina external displays.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
No special application needed for reproducing you can start any JavaFX application which displays text (more then a few words).

Example:
* Install and launch SceneBuilder (tested with 11.0.0 from https://gluonhq.com/products/scene-builder/ )
* Open an FXML file or create a new one
* Display Info dialog (Help > About Scene Builder)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Properly rendered text as it was until macOS 10.14.x.
ACTUAL -
Broken text rendering.

---------- BEGIN SOURCE ----------
Not needed, see "Steps to Reproduce".
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
None.

FREQUENCY : always



Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx17u/pull/195 Date: 2024-07-02 08:21:54 +0000
09-07-2024

[jfx17u-fix-request] Approval Request from José Pereda
02-07-2024

Changeset: a118d333 Author: Phil Race <prr@openjdk.org> Date: 2021-10-20 16:26:48 +0000 URL: https://git.openjdk.java.net/jfx/commit/a118d33314a363336134d31c45b50329594e5a24
20-10-2021

There's another comment and screenshots in the related Linux issue on GitHub, that might be the "another submitter" in the comment above. See: https://github.com/javafxports/openjdk-jfx/issues/229#issuecomment-804546080 I'll attach to this report the two cropped and scaled screenshots I posted in reply to that comment. mgroth0-screen-2x-detail-4x.png - Retina Display detail, cropped and scaled 400% mgroth0-screen-1x-detail-8x.png - External monitor detail, cropped and scaled 800%
24-03-2021

Additional information to JDK-8236689 from another submitter: ============================================= I've been troubled by the same issue, where text looks very bad on an external monitor hooked to a retina mac. I only ever open the window on the external monitor, so if I could just make java think that its running on a mac mini or something and completely ignore retina scaling, that would be perfect. I've found similar (but not the same) issues on stack overflow, which gave me some ideas. I've tried setting `System.setProperty("prism.allowhidpi", "false")` before JavaFX opens, but that doesn't help. I've also tried executing the jar with `-Dsun.java2d.uiScale=1.0`. Neither of these did anything. But the real reason why I'm making this report is because I saw "FixVersion/s: openjfx17" on the original bug report. So I tried building my app with openjfx 17-ea+3. Unfortunately the problem is still there. So I'm a bit confused. Is it supposed to be fixed in openjfx 17?
24-03-2021

I uploaded magnified views of the original four screenshots to show that the problem occurs on both Retina and non-Retina displays. I enlarged the non-Retina images by 800 percent and the Retina images by 400 percent. Based on those magnified screenshots, I'll remove the "on non-retina" suffix in the bug report's title.
25-02-2021

I attached screenshots from my tests as the file "Windows-vs-Linux-vs-macOS.png", originally posted with my GitHub comment. [1] It clearly shows the problem identified by the duplicate bug JDK-8245917, "Color fringes in JavaFX fonts on macOS," now closed. Things may have changed since I ran those tests on May 20, 2020. To reproduce the problem, I ran the Ensemble program, took a screenshot, and then scaled the image by 800 percent. The external visible symptom of the problem is identical to the one we fixed for LInux back in JavaFX 12 for JDK-8188810, "Fonts are blurry on Ubuntu 16.04 and Debian 9." [2] [1] https://github.com/javafxports/openjdk-jfx/issues/229#issuecomment-631797333 [2] https://github.com/javafxports/openjdk-jfx/pull/235
03-11-2020

What we are using to draw the glyph is :- CTFontDrawGlyphs((CTFontRef)arg0, glyphs, pos, 1, (CGContextRef)contextRef); but there's a lot more to it than that. Advance, sub-pixel positioning (a cache for each), bounding box of the image, the OGL code to render the glyph ... The software pipeline only does greyscale so I can't tell anything from trying that. Debugging is needed to even begin to figure out where it is going wrong.
13-01-2020

I can reproduce this. It also fails on JDK 8. I will attach a simple test program and two screen shots, one on an external monitor, which looks bad, and one on the built-in retina screen, which looks fine.
13-01-2020

In both cases (OK/retina and not OK/non-retina) we have LCD glyphs. Perhaps using a Text node or Canvas defaulting to greyscale it is OK ? In the non-retina image , in many instances the right most pixel of the glyph is missing. This could be because it isn't drawn, or is over-drawn. Other than the device scale nothing should be different between the two cases so I am not sure where the problem might be. And when we ask macOS for the glyph images, it is the pixel size that matters not the device scale.
06-01-2020

Here is some additional information that the submitter sent to openjfx-dev [1]. ------------------------------------------------------------ Screenshots of the About Dialog: * NonRetina (broken): https://www.saring.de/openjfx-bugreport/SceneBuilder_About-NonRetina.png (e.g. in line „The default configuration") * Retina (OK): https://www.saring.de/openjfx-bugreport/SceneBuilder_About-Retina.png ------------------------------------------------------------ [1] https://mail.openjdk.java.net/pipermail/openjfx-dev/2020-January/024526.html
06-01-2020