Skip to content

Conversation

@gredler
Copy link
Contributor

@gredler gredler commented May 14, 2025

If the new test (IgnoredWhitespaceTest) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers.

This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers.

It would probably be a good idea to consolidate all of this into the CharToGlyphMapper superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple.


Progress

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

Issue

  • JDK-8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25235

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25235.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 14, 2025

👋 Welcome back dgredler! 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 May 14, 2025

@gredler 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:

8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203

Reviewed-by: honkar, aivanov

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 49 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@honkar-jdk, @aivanov-jdk) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label May 14, 2025
@openjdk
Copy link

openjdk bot commented May 14, 2025

@gredler The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label May 14, 2025
@mlbridge
Copy link

mlbridge bot commented May 14, 2025

Webrevs

Copy link
Contributor

@honkar-jdk honkar-jdk left a comment

Choose a reason for hiding this comment

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

I wasn't able replicate and verify the fix myself as I don't have specific linux flavors (RHEL,SLES) to test it .

@honkar-jdk
Copy link
Contributor

/reviewers 2

@openjdk
Copy link

openjdk bot commented May 14, 2025

@honkar-jdk
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@gredler
Copy link
Contributor Author

gredler commented May 14, 2025

I wasn't able replicate and verify the fix myself as I don't have specific linux flavors (RHEL,SLES) to test it .

I had to build in a clean SUSE Docker image (registry.suse.com/suse/sle15:15.3). Here are my notes on the steps required, if you want to try to replicate (you'll want to adjust the git repo / branch, I think):

zypper in -y wget
wget https://download.java.net/java/GA/jdk24.0.1/24a58e0e276943138bf3e963e6291ac2/9/GPL/openjdk-24.0.1_linux-x64_bin.tar.gz
zypper in -y tar
zypper in -y gzip
tar -xvzf openjdk-24.0.1_linux-x64_bin.tar.gz
wget https://builds.shipilev.net/jtreg/jtreg-7.5.1%2B1.zip
zypper in -y unzip
unzip jtreg-7.5.1+1.zip
zypper in -y git
git clone https://github.com/gredler/jdk.git
cd jdk
git checkout ignored-whitespace
zypper in -y autoconf make awk zip gcc11 gcc11-c++ alsa-devel cups-devel fontconfig-devel
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 20
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 20
zypper in -y libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel
bash configure --with-boot-jdk=/jdk-24.0.1 --with-jtreg=/jtreg
make images
../jtreg/bin/jtreg -jdk:build/linux-x86_64-server-release/images/jdk/ -w build/jtreg/work -r build/jtreg/report -verbose:all test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java
>> java.lang.RuntimeException: Fontconfig head is null, check your fonts or fonts configuration
zypper in -y ghostscript-fonts-std
fc-list
../jtreg/bin/jtreg -jdk:build/linux-x86_64-server-release/images/jdk/ -w build/jtreg/work -r build/jtreg/report -verbose:all test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java

@MBaesken
Copy link
Member

I added your PR to our build/test queue, let's see if it fixes the issues.

Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

Looks good to me.
I didn't try to reproduce the problem. Let's wait for @MBaesken test results.

@MBaesken
Copy link
Member

Looks good to me. I didn't try to reproduce the problem. Let's wait for @MBaesken test results.

Test results look good, with your PR the issue is gone on the 2 Linux machines where we noticed it before .

@gredler
Copy link
Contributor Author

gredler commented May 16, 2025

@MBaesken Thanks for the confirmation!

@honkar-jdk Do you feel OK approving based on the test feedback above?

@honkar-jdk
Copy link
Contributor

honkar-jdk commented May 16, 2025

@honkar-jdk Do you feel OK approving based on the test feedback above?

Sure. Approved. When this code is touched again adding isIgnorableWhitespace() to CharToGlyphMapper would be ideal.

@gredler Suggestion: Probably a good idea to integrate it next week rather than Friday which will allow us to monitor for regressions on CI.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 16, 2025
@gredler
Copy link
Contributor Author

gredler commented May 19, 2025

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 19, 2025
@openjdk
Copy link

openjdk bot commented May 19, 2025

@gredler
Your change (at version fe1fda5) is now ready to be sponsored by a Committer.

@aivanov-jdk
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented May 19, 2025

Going to push as commit 3acfa9e.
Since your change was applied there have been 54 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 May 19, 2025
@openjdk openjdk bot closed this May 19, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 19, 2025
@openjdk openjdk bot removed the sponsor Pull request is ready to be sponsored label May 19, 2025
@openjdk
Copy link

openjdk bot commented May 19, 2025

@aivanov-jdk @gredler Pushed as commit 3acfa9e.

💡 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

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants