Font hinting on Linux

quizynox quizynox at gmail.com
Mon Aug 5 04:09:53 UTC 2024


Hello,

Thanks for the answer. I've found a couple of very long but very
informative threads that have given me some pointers.

Poor quality font rendering
https://mail.openjdk.org/pipermail/openjfx-dev/2013-August/009958.html

The crisp fonts saga
https://mail.openjdk.org/pipermail/openjfx-dev/2023-December/044234.html

In my case there were two problems:

- I had SceneAntialiasing enabled, which seems to prevent
-fx-smoothing-type=lcd from working
- I forgot that -fx-smoothing-type is only enabled for .text nodes, but not
for all Text nodes by default

I also assumed that Linux fontconfig settings would have some effect on
JavaFX font rendering, but judging from tests this isn't the case. Perhaps
the only thing that matters is freetype compilation flags. I've found that
Fedora enabled ClearType font rendering some time ago (
https://www.phoronix.com/news/Fedora-ClearType-Subpixel-Font).

As for -fx-smooth-type=gray, with some fonts such as Open Sans, Liberation
Sans or Montserrat it may look quite close to acceptable.

вс, 4 авг. 2024 г. в 01:41, Philip Race <philip.race at oracle.com>:

> There's not many knobs available. Hinting is not enabled - and that's
> commonly the case on modern plartforms.
> LCD is your best option for readibility of static text, which is why it
> is the default for UI Controls,
> It should reduce the pixel grid fitting uneveness you highlight but
> doesn't eliminate it.
> Note : this presumes that the freetype on your system enables LCD .. if
> it doesn't there's nothing FX can do about that.
>
> -phil.
>
>
> On 8/2/24 10:43 AM, quizynox at gmail.com wrote:
> > Hello,
> >
> > Sorry for asking here, but I seem to have tried everything I could
> > find on SO/Reddit/JBS etc. Could someone please share what font
> > settings I should be using to get decent font hinting on Linux? Please
> > see the screenshot.
> >
> > https://drive.google.com/file/d/1gXYXzbcq4cHmZpza20yQJHfs0pMbgiZa/view
> >
> > I'm not very picky, but the font I see is just not suitable for
> > presenting app to customers. I've tried enabling and disabling hinting
> > and autohinting, using different hinting styles, changing the font
> > smoothing type and prism.lcdtext etc. Unfortunately no matter what I
> > do, the font hinting is always bad.
> >
> > Fedora, KDE, all latest versions.
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240805/0ce4ad08/attachment.htm>


More information about the openjfx-dev mailing list