JDK-8191758 : Match WebKit's font weight rendering with JavaFX
Type:Bug
Component:javafx
Sub-Component:web
Affected Version:8u172,10
Priority:P3
Status:Resolved
Resolution:Fixed
Submitted:2017-11-22
Updated:2020-08-25
Resolved:2020-04-30
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
changes looks fine..
Need to find out why this test case passed in linux..
22-11-2017
is this issue specific to OSX and windows ? I see in linux, the DRT fast/text/system-font-weight-italic.html is PASSED.
can you point me the code in webcore where isFontWeightBold() returns true for weight greater than 600.
It is working in previous WebKit because "isBold" parameter ensures it, but in the new WebKit "isBold" parameter is dropped and only "fontWeight" is passed to the platform.
Currently we use "isFontWeightBold()" method to determine whether it is bold or not. "isFontWeightBold()" return true for weight value greater than 600, but JavaFX considers bold only if FontWeight is >= 700. Please refer "PrismFontLoader.font" method and FontWeight doc[1]
// REMIND. Some day need to have better granularity.
boolean bold = weight != null &&
weight.ordinal() >= FontWeight.BOLD.ordinal();
(Note: JavaFX also doesn't support font weight properly, only normal and bold is supported.)
[1] https://docs.oracle.com/javase/9/docs/api/javafx/scene/text/FontWeight.html#BOLD