The crisp fonts saga

John Hendrikx john.hendrikx at gmail.com
Sun Dec 17 14:49:20 UTC 2023


On 16/12/2023 23:02, Mark Raynsford wrote:
> On Sat, 2023-12-16 at 12:10 -0800, John Neffenger wrote:
>> I would prefer not to have the tyranny of the project default
>> replaced
>> with a new tyranny of the app default. :-)
>>
>> Wouldn't it be nice to allow developers and end users to enable
>> hinting
>> for any JavaFX application just by defining a system property?
> That is a good point. I had forgotten that most applications don't
> allow the user to specify their own CSS.
>
> What's the expected precedence? I assume it's:
>
> * If the CSS specifies a setting, and the corresponding property isn't
>    set, the CSS wins.
> * If the property specifies a setting, and the CSS isn't set, the
>    property wins.
> * If the CSS specifies a setting, and the corresponding property
> specifies a setting, the property wins.

It should be INLINE > AUTHOR > USER > USER_AGENT (see StyleOrigin)

This means that `setStyle` wins over `getStyleSheets().add`, which wins 
over a property set by the developer which wins over the default FX 
Stylesheet.

However, there is a bug there. If you set a property at any time, it 
will override the value.  If however an Author Stylesheet CSS is applied 
afterwards, it will override the property again. It effectively makes 
AUTHOR and USER the same level, last one wins...

--John



More information about the openjfx-dev mailing list