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

8191758: Match WebKit's font weight rendering with JavaFX #180

Closed
wants to merge 3 commits into from

Conversation

@bhaweshkc
Copy link
Collaborator

@bhaweshkc bhaweshkc commented Apr 14, 2020

As per JavaFx 700 font weight is considered to be bold but webkit is using 600 font weight for text to become bold. to fix issue, use boldWeightValue() function which uses 700 font weight rather than isFontWeightBold() which compare against 600 font weight.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8191758: Match WebKit's font weight rendering with JavaFX

Reviewers

  • Kevin Rushforth (kcr - Reviewer)
  • Arun Joseph (ajoseph - Committer)

Download

$ git fetch https://git.openjdk.java.net/jfx pull/180/head:pull/180
$ git checkout pull/180

@bridgekeeper bridgekeeper bot added the oca label Apr 14, 2020
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 14, 2020

Hi @bhaweshkc, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user bhaweshkc" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@bhaweshkc
Copy link
Collaborator Author

@bhaweshkc bhaweshkc commented Apr 14, 2020

/covered

@bridgekeeper bridgekeeper bot added the oca-verify label Apr 14, 2020
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 14, 2020

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Apr 16, 2020

/reviewers 2

@openjdk
Copy link

@openjdk openjdk bot commented Apr 16, 2020

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Apr 16, 2020

Can you add a unit test to go along with this fix?

@kevinrushforth kevinrushforth self-requested a review Apr 16, 2020
@openjdk openjdk bot added the rfr label Apr 17, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 17, 2020

@prrace
Copy link
Collaborator

@prrace prrace commented Apr 17, 2020

Per the opentype spec, 700 is bold. 600 is semi-bold
https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass

CSS agrees : https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight

So are you saying webkit has been using bold at a lower weight than these specs suggest ?
I see the logic all comes from Source/WebCore/platform/graphics/FontSelectionAlgorithm.h

I suppose the existing code thinks that if we have reached what that file calls the bold threshold of 600 then we should use bold. It isn't necessarily "wrong" but I think I agree that it is more important to be consistent with the rest of Java FX ... which I believe is the point of this change ?

@openjdk openjdk bot removed the rfr label Apr 21, 2020
bhawesh
@bhaweshkc bhaweshkc force-pushed the bhaweshkc:font_weight branch from 43c7cbf to f6fb107 Apr 21, 2020
@openjdk openjdk bot added the rfr label Apr 21, 2020
@bhaweshkc
Copy link
Collaborator Author

@bhaweshkc bhaweshkc commented Apr 21, 2020

@prrace
yes, webkit is set to use 600 weight where javafx consider 700 weight for it to be consider bold.
https://docs.oracle.com/javafx/2/api/javafx/scene/text/FontWeight.html

@bhaweshkc bhaweshkc removed their assignment Apr 21, 2020
Copy link
Member

@kevinrushforth kevinrushforth left a comment

The fix and test look good. I confirm that your new test fails without your fix and passes with your fix.

I left one style comment and will approve once you fix that.

bhawesh
@openjdk
Copy link

@openjdk openjdk bot commented Apr 30, 2020

@bhaweshkc This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

8191758: Match WebKit's font weight rendering with JavaFX

Reviewed-by: kcr, ajoseph
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /solves command.

Since the source branch of this PR was last updated there have been 36 commits pushed to the master branch:

  • 66c3b38: 8227425: Add support for e-paper displays on i.MX6 devices
  • e30049f: 8242077: Add information about HTTP/2 and HttpClient usage in WebEngine
  • e0ffca3: 8242505: Some WebKit tests might fail because Microsoft libraries are not loaded
  • ceb3fce: 8087555: [ChoiceBox] uncontained value not shown
  • 818ac00: 8175358: Memory leak when moving MenuButton into another Scene
  • 91d4c8b: 8241737: TabPaneSkin memory leak on replacing selectionModel
  • 48476eb: 8241582: Infinite animation does not start from the end when started with a negative rate
  • dedf7cb: 8242490: Upgrade to gcc 9.2 on Linux
  • 5e9fb82: 8242577: Cell selection fails on iOS most of the times
  • 69e4266: 8242489: ChoiceBox: initially toggle not sync'ed to selection
  • ... and 26 more: https://git.openjdk.java.net/jfx/compare/364c64a2e55b561df4ca1afc85c91054b339eea8...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate 66c3b385d8f95cdb874836b450e1bdbc2667d28a.

As you are not a known OpenJDK Author, an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kevinrushforth, @arun-Joseph) 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 ready label Apr 30, 2020
@bhaweshkc
Copy link
Collaborator Author

@bhaweshkc bhaweshkc commented Apr 30, 2020

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Apr 30, 2020

@bhaweshkc
Your change (at version 473eec6) is now ready to be sponsored by a Committer.

@openjdk openjdk bot added the sponsor label Apr 30, 2020
@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Apr 30, 2020

/sponsor

@openjdk openjdk bot closed this Apr 30, 2020
@openjdk openjdk bot added integrated and removed sponsor ready rfr labels Apr 30, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Apr 30, 2020

@kevinrushforth @bhaweshkc The following commits have been pushed to master since your change was applied:

  • 66c3b38: 8227425: Add support for e-paper displays on i.MX6 devices
  • e30049f: 8242077: Add information about HTTP/2 and HttpClient usage in WebEngine
  • e0ffca3: 8242505: Some WebKit tests might fail because Microsoft libraries are not loaded
  • ceb3fce: 8087555: [ChoiceBox] uncontained value not shown
  • 818ac00: 8175358: Memory leak when moving MenuButton into another Scene
  • 91d4c8b: 8241737: TabPaneSkin memory leak on replacing selectionModel
  • 48476eb: 8241582: Infinite animation does not start from the end when started with a negative rate
  • dedf7cb: 8242490: Upgrade to gcc 9.2 on Linux
  • 5e9fb82: 8242577: Cell selection fails on iOS most of the times
  • 69e4266: 8242489: ChoiceBox: initially toggle not sync'ed to selection
  • 1d88180: 8243112: Skip failing test SVGTest.testSVGRenderingWithPattern
  • ec8608f: 8223298: SVG patterns are drawn wrong
  • e82046e: 8242530: [macos] Some audio files miss spectrum data when another audio file plays first
  • 7044cef: 8241476: Linux build warnings issued on gcc 9
  • 9d50c4c: Merge
  • 4d69a0d: 8241629: [macos10.15] Long startup delay playing media over https on Catalina
  • b1fdc45: 8242209: Increase web native thread stack size for x86 mode
  • e1cb191: 8240694: [macos 10.15] JavaFX Media hangs on some video files on Catalina
  • c154538: 8242106: [macos] Remove obsolete GlassView2D.m class
  • 3f663e3: 8240262: iOS refresh rate is capped to 30 Hz
  • 231879a: 8241710: NullPointerException while entering empty submenu with "arrow right"
  • 470c7d0: 8230809: HTMLEditor formatting lost when selecting all (CTRL-A)
  • fda015c: 8242167: ios keyboard handling
  • 844460b: 8242163: Android keyboard integration fails
  • ef37669: Merge
  • f2bca9f: Merge
  • 6900d29: Merge
  • e91bec4: Merge
  • 66a8f49: Merge
  • fde42da: Merge
  • e21fd1f: Merge
  • 443c845: Merge
  • 31e63de: Merge
  • 14c6938: 8236798: Enhance FX scripting support
  • bfb2d0e: Merge
  • 39f6127: Merge

Your commit was automatically rebased without conflicts.

Pushed as commit 8ad5805.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants