RFR: 8191758: Match WebKit's font weight rendering with JavaFX

Phil Race prr at openjdk.java.net
Fri Apr 17 18:08:16 UTC 2020

On Thu, 16 Apr 2020 12:40:24 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> 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.
> Can you add a unit test to go along with this fix?

Per the opentype spec, 700 is bold. 600 is semi-bold

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 ?


PR: https://git.openjdk.java.net/jfx/pull/180

More information about the openjfx-dev mailing list