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

8281327: JavaFX does not support fonts installed per-user on Windows 10/11 #1017

Closed
wants to merge 1 commit into from

Conversation

jperedadnr
Copy link
Collaborator

@jperedadnr jperedadnr commented Jan 31, 2023

This PR simply applies the patch from JDK-8218914 that solved the same issue for the JDK.

I've tested it on Windows 11 (Version 22H2 Build 22621.1105).

I have the Roboto font installed under C:\Users%user\AppData\Local\Microsoft\Windows\Fonts
and with this PR, -Dprism.debugfonts shows:

...
font=segoe ui historic file=seguihis.ttf
font=roboto file=C:\Users\%user\AppData\Local\Microsoft\Windows\Fonts\Roboto-Regular.ttf
font=yu mincho file=yumin.ttf
...

Also, I can see that the font is picked in a simple JavaFX application.
Without this PR, the font is not used, and defaults to a system one.

I don't think I can add this as a system/manual test to the PR, though.


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-8281327: JavaFX does not support fonts installed per-user on Windows 10/11

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1017

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 31, 2023

👋 Welcome back jpereda! 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 openjdk bot added the rfr Ready for review label Jan 31, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 31, 2023

Webrevs

@Glavo
Copy link
Contributor

Glavo commented Jan 31, 2023

That is great! We have been looking forward to this patch for two years.

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Jan 31, 2023

@kevinrushforth
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).


if (ret != ERROR_SUCCESS ||
dwMaxValueNameLen >= MAX_BUFFER ||
dwMaxValueDataLen >= MAX_BUFFER) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This implementation instantly fails if any value or data exceeds MAX_BUFFER. Wouldn't it be better to only skip the values that are too large, instead of ignoring all values entirely?

Instead of using RegQueryInfoKeyW, the documentation suggests the following approach:

To enumerate values, an application should initially call the RegEnumValue function with the dwIndex parameter set to zero. The application should then increment dwIndex and call the RegEnumValue function until there are no more values (until the function returns ERROR_NO_MORE_ITEMS).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please note that this is just a refactoring of the existing code, extracting a method so that it can be called twice, and it is also what the JDK is doing.
If the affected code needs changes, maybe that is for a follow up.

Copy link
Collaborator

@prrace prrace left a comment

Choose a reason for hiding this comment

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

Code looks good and I applied the patch and verified it works as advertised.

@openjdk
Copy link

openjdk bot commented Feb 16, 2023

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

8281327: JavaFX does not support fonts installed per-user on Windows 10/11

Reviewed-by: prr, arapte

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 21 new commits pushed to the master branch:

  • dbab36b: 8300893: Wrong state after deselecting two or more cells of a TableView selection
  • 97ae4b8: 8302294: Cherry-pick WebKit 615.1 stabilization fixes
  • d1572f4: 8298528: Clean up raw type warnings in base in bindings and collections packages
  • de8339d: 8088998: XYChart: duplicate child added exception when remove & add a series in several charts
  • 55eb83d: 8299986: Wrong sublist used in ListChangeListener
  • d3654e3: 8230833: LabeledSkinBase computes wrong height with ContentDisplay.GRAPHIC_ONLY
  • e7d3191: Merge
  • abe8058: 8301832: InputMethodEvents are not enabled for text input controls
  • 192ba4f: 8301797: Pagination control has the wrong size
  • 13d8df3: 8301712: [linux] Crash on exit from WebKit 615.1
  • ... and 11 more: https://git.openjdk.org/jfx/compare/e234c89a253ece4962803a05d6ef77f0a7a80a82...master

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 added the ready Ready to be integrated label Feb 16, 2023
@jperedadnr
Copy link
Collaborator Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 16, 2023

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

  • dbab36b: 8300893: Wrong state after deselecting two or more cells of a TableView selection
  • 97ae4b8: 8302294: Cherry-pick WebKit 615.1 stabilization fixes
  • d1572f4: 8298528: Clean up raw type warnings in base in bindings and collections packages
  • de8339d: 8088998: XYChart: duplicate child added exception when remove & add a series in several charts
  • 55eb83d: 8299986: Wrong sublist used in ListChangeListener
  • d3654e3: 8230833: LabeledSkinBase computes wrong height with ContentDisplay.GRAPHIC_ONLY
  • e7d3191: Merge
  • abe8058: 8301832: InputMethodEvents are not enabled for text input controls
  • 192ba4f: 8301797: Pagination control has the wrong size
  • 13d8df3: 8301712: [linux] Crash on exit from WebKit 615.1
  • ... and 11 more: https://git.openjdk.org/jfx/compare/e234c89a253ece4962803a05d6ef77f0a7a80a82...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 16, 2023

@jperedadnr Pushed as commit f4ca00d.

💡 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
6 participants