The crisp fonts saga

Michael Strauß michaelstrau2 at gmail.com
Fri Dec 15 22:39:44 UTC 2023


Hi Mark,

maybe you should start a new thread with your proposed API and a quick
summary of the problems that it solves.

OpenJFX is a community effort after all, so let’s see whether we can get
your proposal accepted.


Mark Raynsford <org.openjdk at io7m.com> schrieb am Fr. 15. Dez. 2023 um 23:21:

> On Fri, 2023-12-15 at 13:40 -0800, Philip Race wrote:
> > I already gave a brief explanation of why FX text rendering is what
> > it is.
> > I will expand on it a bit but a number of the salient points have
> > already been made by others.
> > It is unlikely we will make anything other than carefully considered
> > tweaks, so this is by way of explanation.
>
> I'm actually not even asking to change the defaults. The dictated-from-
> above defaults are the problem. I am inevitably going to fork JavaFX
> and maintain a patched version even if the changes won't be accepted
> upstream. These are the changes I intend to make:
>
>   1. Add an -fx-font-bitmaps CSS attribute that, by default, will be
>      set to false. Setting this value to true will cause bitmap
>      information to be loaded if present, and ignored otherwise.
>
>   2. Add an -fx-font-hinting CSS attribute that, by default, will be
>      set to false. Setting this value to true will enable hinting
>      using whatever is the default (in other words, not setting
>      FT_LOAD_NO_HINTING).
>
>   3. Add an extra value to -fx-font-smoothing: none. Setting this
>      will use FT_LOAD_TARGET_MONO and disable effectively disable
> antialiasing. This is important for my users for small-text
> console components.
>
> I'm just tired of my applications looking like optical migraines when
> everyone else on the planet (including the UI library in the JDK
> itself) manages to look better, regardless of the apparent technical
> consequences for frankly niche cases.
>
> > Some people absolutely insist that being true to the design is what
> > is most important
> > A high contrast is the most important to someone else.
> > No jaggies is important to another person.
> > Hinting is essential to some people in some cases. To other people it
> > is anathema. etc, etc.
>
> And by disallowing developers to change the behaviour in any way,
> you're deciding this for them. You're effectively pleasing the smallest
> set of people possible.
>
> > And then on top of that hinting is not even designed to be used in
> > such rotated cases.
>
> So we must all pay for ugly text because someone somewhere wants to
> spin text around, and we don't get to opt-out.
>
> > And as the Amble case points out, you are dependent on the quality of
> > the hinting which is very expensive. Poor hinting is worse than none.
>
> So JavaFX, which has no idea which fonts I'm bundling, is clearly more
> qualified than I am to decide whether I want hinting or not.
>
> > And animations using text - not common in Swing, but central to FX -
> > are very jerky if you use hinting.
>
> It's almost as if there's some kind of design flaw, and a ton of work
> to maintain a feature that I've yet to see anyone actually say that
> they care about. Take a look at any modern 3D rendering engine with UI
> support, and you won't see these issues, and they not only perform
> scaling and rotation but frequently perspective projection onto 3D
> surfaces.
>
> > And "bitmaps" in a font are extremely rare.
>
> Maybe in the fonts you use. "Extremely rare" is entirely subjective;
> there's an entire field of programmer fonts that use carefully tuned
> bitmaps to stay sharp. Guess we're just not allowed to use those
> either, because JavaFX says so.
>
> > LCD text also doesn't work well with rotations because the 3X
> > resolution you get is only in one orientation.
>
> On that we agree. I have no interest in LCD text on any platform.
>
> Guess I'll get working on the fork.
>
> --
> Mark Raynsford | https://www.io7m.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231215/ef918c95/attachment.htm>


More information about the openjfx-dev mailing list