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

8322251: [Linux] JavaFX is not displaying CJK on Ubuntu 23.10 and later #1439

Closed
wants to merge 1 commit into from

Conversation

prrace
Copy link
Collaborator

@prrace prrace commented Apr 10, 2024

The Linux font lookup code is rejecting CFF OpenType fonts.
Since these are becoming common because of the Noto family this could soon be quite a problem.
I expect this fix is a candidate for backporting.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8322251: [Linux] JavaFX is not displaying CJK on Ubuntu 23.10 and later (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1439/head:pull/1439
$ git checkout pull/1439

Update a local copy of the PR:
$ git checkout pull/1439
$ git pull https://git.openjdk.org/jfx.git pull/1439/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1439

View PR using the GUI difftool:
$ git pr show -t 1439

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1439.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 10, 2024

👋 Welcome back prr! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Apr 10, 2024

@prrace This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8322251: [Linux] JavaFX is not displaying CJK on Ubuntu 23.10 and later

Reviewed-by: aghaisas, angorya

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 20 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title 8322251 8322251: [Linux] JavaFX is not displaying CJK on Ubuntu 23.10 and later Apr 10, 2024
@openjdk openjdk bot added the rfr Ready for review label Apr 10, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 10, 2024

Webrevs

* ie TrueType and CFF format fonts.
*/
if ((fontformat != NULL) &&
((strcmp((char*)fontformat, "TrueType") != 0) &&
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code in javax.web uses equalLettersIgnoringASCIICase in a similar situation, should we use case-insensitive comparison here?

Copy link
Collaborator Author

@prrace prrace Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that but we have been using specific-case here for ever for TrueType and also in the Java 2D code - which BTW does allow CFF already and it looks for 'CFF' and more to the point the fontconfig API we are using itself explicitly looks for 'CFF' which it in turn gets by using freetype to examine font files and the API in freetype it uses says

   *  FT_Get_Font_Format
   *
   * @description:
   *  Return a string describing the format of a given face.  Possible values
   *  are 'TrueType', 'Type~1', 'BDF', 'PCF', 'Type~42', 'CID~Type~1', 'CFF',
   *  'PFR', and 'Windows~FNT'.

So it is baked in from the start what case is used.

@andy-goryachev-oracle
Copy link
Contributor

The windows build failure is unrelated:

curl: (28) Failed to connect to www.cygwin.com port 443 after 21041 ms: Couldn't connect to server
Start-Process: D:\a\_temp\46314114-c9de-404b-9d61-702019e10c7b.ps1:4
Line |
   4 |  Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | This command cannot be run due to the error: The system cannot find the file specified.
Error: Process completed with exit code 1.

Copy link
Collaborator

@aghaisas aghaisas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks straightforward and logical.

@openjdk openjdk bot added the ready Ready to be integrated label Apr 18, 2024
@andy-goryachev-oracle
Copy link
Contributor

the code looks right, I just can't verify the fix on a real system.

@prrace
Copy link
Collaborator Author

prrace commented Apr 18, 2024

the code looks right, I just can't verify the fix on a real system.

Well, yes, I had to install 23.10 in a VirtualBox VM, then clone FX on to it along with all the tools
needed to build and test.
So it is definitely something that needs work to actually test. It was more work than the actual bug fix.

@beldenfox
Copy link
Contributor

I already had 23.10 ARM VM's configured. I was able to reproduce the original bug and verify that this PR fixes it. I can't comment on the code itself.

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @beldenfox for confirming!

@prrace
Copy link
Collaborator Author

prrace commented Apr 19, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Apr 19, 2024

Going to push as commit 5182ea1.
Since your change was applied there have been 20 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 19, 2024
@openjdk openjdk bot closed this Apr 19, 2024
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Apr 19, 2024
@openjdk
Copy link

openjdk bot commented Apr 19, 2024

@prrace Pushed as commit 5182ea1.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
4 participants