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

Fonts with contextual alternates are not correct rendered #448

Open
BuZZ-dEE opened this issue Feb 2, 2023 · 9 comments
Open

Fonts with contextual alternates are not correct rendered #448

BuZZ-dEE opened this issue Feb 2, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@BuZZ-dEE
Copy link

BuZZ-dEE commented Feb 2, 2023

Bountysource

Pay attention to the e's, for example:

Amazon Corretto 8: wrong rendering for font size less than 101 and other wrong rendering for font size greater than 100
java-8_font_with_contextual_alternates_not_correct_rendering_below_font_size_100

Amazon Corretto 11-16, 19: wrong rendering for font size less than 101 and correct rendering for font size greater than 100
java-19_font_with_contextual_alternates_not_correct_rendering_below_font_size_100

Example code:
FontRederingErrorDemo.zip

Fonts with feature contextual alternates:

OS:

  • Linux:
lsb_release -a
LSB Version:	1.4
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a

uname -a
Linux 5.11.15-zen1-2-zen #1 ZEN SMP PREEMPT Sat, 17 Apr 2021 00:22:34 +0000 x86_64 GNU/Linux
  • Windows 10

It would be great if this could be fixed for OpenJDK 8 (for all sizes).

@BuZZ-dEE BuZZ-dEE added the bug Something isn't working label Feb 2, 2023
@BuZZ-dEE
Copy link
Author

BuZZ-dEE commented Feb 2, 2023

@lutkerd
Copy link
Contributor

lutkerd commented Feb 2, 2023

Corretto is using FreeType for the rendering, can you try the tools mentioned on this page to see if this is a problem with FreeType directly?

Reporting a Bug

In case you find a bug, which you think is related to FreeType, please check the problematic font with one of our demo programs, for example ftview or ftstring. In case the problem persists, consult FreeType's issue list to find out whether the problem has been reported already. Otherwise, please submit a new issue. It is helpful to use the git version (see above) of FreeType and its demo programs for testing if possible since we don't release FreeType very often.

@apodtele
Copy link

apodtele commented Feb 2, 2023

Unlikely FreeType issue. Do you use HarfBuzz?

@navyxliu
Copy link
Contributor

navyxliu commented Feb 2, 2023

I don't think we can use HarfBuzz in Corretto-8 right now. The integration of HarfBuzz has been delivered in jdk9^ref and never get backported to jdk8u.

I don't think I have sufficient knowledge on this topic. just offer 2 cents I found on internet. it looks like freetype can also handle OpenType Layout.

We are proud to announce that FreeType now supports the OpenType Layout extension tables (also formerly known as TrueType Open).

if we update our freetype in corretto-8, can we solve this issue?

@apodtele
Copy link

apodtele commented Feb 2, 2023

Wow. You found some really old page and forgot to quote the top warning. :) I am 100% sure that you do not use FreeType 1 because nobody has been for 20 years.

In a nutshell. FreeType 2 does not do perform any text layout. FreeType only reads font files and returns scaled glyph images per client (layout library) request. We simply do not have facilities to interpret contextual variations. You must be using something else for layout.

@benty-amzn
Copy link
Contributor

I believe the font layout code resides here. I'm not familiar with that part of the codebase, but if this issue impacts multiple vendors and not just Corretto (seems so based on the referenced Adoptium issue), we can consider opening an issue for it at https://bugs.openjdk.org/

@lutkerd
Copy link
Contributor

lutkerd commented Feb 2, 2023

Corretto-11+ on Linux is built to use the bundled lib in the repository so it will use FreeType 2.12.1 and HarfBuzz 4.4.1.
Corretto-8 will use the system FreeType and I believe the ICU Layout engine (See https://openjdk.org/projects/harfbuzz/).

Corretto-8 and upstream OpenJDK8 are in maintenance mode and are only accepting critical fixes.

In the description you mentioned testing on 11-16 and 19? Did you mean 11-17? If the root cause can be identified we could get it fixed in the tip version of OpenJDK and backported to 17 and 20 which will be the feature release for the next quarterly release.

@BuZZ-dEE
Copy link
Author

BuZZ-dEE commented Feb 2, 2023

In the description you mentioned testing on 11-16 and 19? Did you mean 11-17?

No, I have not yet tested it with 17. The issue from Adoptium was created long ago, the newest version was 16 at that time. Today I tested it with 19 and this issue is still there, so I assume 17 is also affected.

@BuZZ-dEE
Copy link
Author

BuZZ-dEE commented Feb 7, 2023

I believe the font layout code resides here. I'm not familiar with that part of the codebase, but if this issue impacts multiple vendors and not just Corretto (seems so based on the referenced Adoptium issue), we can consider opening an issue for it at https://bugs.openjdk.org/

@benty-amzn Yes please, open an issue in OpenJDK. I would do it by myself, but I can not, because I do not have the permissions. It is really a complicated process to get things reported in OpenJDK as an "Ottonormalverbraucher".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants