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

Freetype 2.9.1 renders fonts poorly on Windows 10 #1059

Open
paharvey opened this issue Apr 28, 2019 · 11 comments
Open

Freetype 2.9.1 renders fonts poorly on Windows 10 #1059

paharvey opened this issue Apr 28, 2019 · 11 comments
Labels
bug Issues that are problems in the code as reported by the community code-tools Issues that are miscellaneous enhancements or bugs with our utilities that assist our build scripts Waiting on OP Issues that are awaiting a response from the original author of the ticket windows Issues that affect or relate to the WINDOWS OS
Milestone

Comments

@paharvey
Copy link

Platform: Windows 10

Architecture: 64-bit

Freetype 2.7 contains a change that led to poorer quality font rendering on Windows.

  • Your Java 8/9/10 builds for Windows appear to use Freetype 2.5.3, so fonts look fine.
  • Your Java 11+ builds for Windows appear to use Freetype 2.9.1, so fonts look worse.

As a workaround, users can use pre-2.7 font rendering by setting an environment variable:
FREETYPE_PROPERTIES=truetype:interpreter-version=35

A better solution may be to revert back to an earlier version of Freetype for Java 11+. Even better, someone could work out how to set "truetype:interpreter-version=35" as the default when compiling Freetype as part of the OpenJDK build process.

Note that most OpenJDK distributions also appear to be impacted by this issue. There are a few bugs already posted on OpenJDK's bug tracking system, but I am unable to add comments to those bugs: https://bugs.openjdk.java.net/browse/JDK-8214538

@karianna karianna added this to the April 2019 milestone Apr 29, 2019
@karianna karianna added the bug Issues that are problems in the code as reported by the community label Apr 29, 2019
@karianna
Copy link
Contributor

Platform: Windows 10

Architecture: 64-bit

Freetype 2.7 contains a change that led to poorer quality font rendering on Windows.

  • Your Java 8/9/10 builds for Windows appear to use Freetype 2.5.3, so fonts look fine.
  • Your Java 11+ builds for Windows appear to use Freetype 2.9.1, so fonts look worse.

As a workaround, users can use pre-2.7 font rendering by setting an environment variable:
FREETYPE_PROPERTIES=truetype:interpreter-version=35

A better solution may be to revert back to an earlier version of Freetype for Java 11+. Even better, someone could work out how to set "truetype:interpreter-version=35" as the default when compiling Freetype as part of the OpenJDK build process.

FYI - I think this should be the actual fix

Note that most OpenJDK distributions also appear to be impacted by this issue. There are a few bugs already posted on OpenJDK's bug tracking system, but I am unable to add comments to those bugs: https://bugs.openjdk.java.net/browse/JDK-8214538

@karianna karianna removed this from the April 2019 milestone Apr 29, 2019
@karianna karianna modified the milestones: April 2019, May 2019 Apr 29, 2019
@ali-ince
Copy link
Contributor

ali-ince commented May 9, 2019

@paharvey can you please confirm that setting FREETYPE_PROPERTIES=truetype:interpreter-version=35 environment variable has any positive effect on your environment?

With the test I've done locally (i.e. running visualvm) it seems to have no effect. And furthermore, for this case reverting back to previous freetype versions / upgrading to the latest version does not change anything at all.

Will keep investigating.

@ali-ince
Copy link
Contributor

ali-ince commented May 9, 2019

Hmm, ok - my bad. The issues I was seeing were about HiDPI support.

@M-Davies
Copy link
Contributor

Hi @paharvey . After discussions in Slack, we found that we are using Freetype 2.9.1 for JDK11+ builds since we do not set the freetype version in our windows setup script. The solution for this would be to simply add a line in the elif statement for JDK11+ builds that exports our freetype version into the build args.

Once I have confirmed that using 2.9.1 is not required for JDK11+ on both Hotspot and OpenJ9 on slack, I can make this change.

@karianna
Copy link
Contributor

Freetype is now at 2.10.2 so I think we should upgrade to that (and see if it fixes the OP’s issue).

@karianna
Copy link
Contributor

Looks like https://bugs.openjdk.java.net/browse/JDK-8217731 was backported. @paharvey are you able to try Adopt 11.0.7 build and see if the issue has been corrected?

@karianna karianna added the Waiting on OP Issues that are awaiting a response from the original author of the ticket label May 21, 2020
@M-Davies
Copy link
Contributor

I created a PR as we should upgrade freetype anyway if there is a newer version out. I'd like to sit on it for a little while though as I wait for the opinions of the openj9 folks

@karianna karianna added this to the May 2020 milestone May 24, 2020
@sxa
Copy link
Member

sxa commented May 28, 2020

we should upgrade freetype anyway if there is a newer version out

Upgrading just because there's a later version is potentially risky though.

Have we verified whether the OP's issue is resolved by 2.10.2 yet? Otherwise this conversation is rather pointless and 2.5.3 would likely be the better option.

@M-Davies
Copy link
Contributor

M-Davies commented May 28, 2020

Have we verified whether the OP's issue is resolved by 2.10.2 yet?

I'm not sure how the OP tested that the fonts were not rendering properly. Without knowing that, I'm not sure how we can verify if the issue is resolved by using 2.10.2

@sxa
Copy link
Member

sxa commented May 28, 2020

The test case is in the openjdk bug referenced above. However I cannot reproduce the problem using the Windows x86-32 builds on my system (Which admittedly is an aarch64 one!) with either 11.0.7 or 11.0.5, but we should verify on a proper WIn/x64 system

@karianna karianna modified the milestones: May 2020, June 2020 Jun 1, 2020
@karianna karianna modified the milestones: June 2020, July 2020 Jul 1, 2020
@karianna karianna modified the milestones: July 2020, August 2020 Aug 3, 2020
@M-Davies M-Davies removed their assignment Aug 4, 2020
@karianna karianna modified the milestones: August 2020, September 2020 Sep 1, 2020
@karianna karianna modified the milestones: September 2020, November 2020 Nov 3, 2020
@M-Davies M-Davies added code-tools Issues that are miscellaneous enhancements or bugs with our utilities that assist our build scripts windows Issues that affect or relate to the WINDOWS OS labels Nov 27, 2020
@karianna karianna modified the milestones: November 2020, December 2020 Jan 3, 2021
@karianna karianna modified the milestones: December 2020, March 2021 Mar 8, 2021
@karianna karianna removed their assignment Apr 13, 2021
@karianna
Copy link
Contributor

@paharvey Can you test with the latest 11.0.15? This should be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that are problems in the code as reported by the community code-tools Issues that are miscellaneous enhancements or bugs with our utilities that assist our build scripts Waiting on OP Issues that are awaiting a response from the original author of the ticket windows Issues that affect or relate to the WINDOWS OS
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

5 participants