The crisp fonts saga

Mark Raynsford org.openjdk at io7m.com
Fri Dec 15 11:39:48 UTC 2023


On Thu, 2023-12-14 at 15:02 -0800, John Neffenger wrote:
> On 12/14/23 4:39 AM, Mark Raynsford wrote:
> > The key point is "keep text aligned to the pixel grid". The thing
> > is:
> > This isn't affected by hinting or the lack of it whatsoever, at
> > least
> > with the way text is implemented in Prism and Freetype, as far as I
> > can
> > tell.
> 
> It seems to have influenced the original choice for JavaFX. Felipe 
> Heidrich addresses the font scaling issue at 30:54 in his
> presentation:
> 
> Hinting (30m 54s into the video)
> https://www.youtube.com/watch?v=LCrCni6EVek&t=1854s
> 
> When using hinting, he says ...
> 
> ----------------------------------------
> You're going to compromise the intent, and again, you're going to 
> compromise the linearity. So again, if you start scaling, things are 
> going to start jumping.
> 
> They're going to start jumping because they've got to fix the pixel
> grid 
> here and there, or just like, the stems or the crossbars in the
> glyphs 
> are going to ... it will go like, point 12, point 13, 14, and things 
> look to be going well, then go 14, 15, kind of gives a jump and 
> everything kind of doubles.

So what he's describing is scaling in terms of changing the underlying
font size and regenerating glyphs at each animation step. As in, if you
implement zooming text by displaying fonts at size 12.12pt, 12.13pt,
12.14pt, etc.

Is this really such a serious problem and urgent use-case that we have
to live with awful text rendering to support it? The only applications
I can think of that do text zooming like this are web browsers and,
even there, there's no expectation of smoothly animating fonts between
different sizes (and the layout is going to jump around all over the
place anyway, due to other objects on web pages changing sizes). This
seems like an extremely bad trade-off.

These days, we have GPUs. Render text at a few fixed sizes and linearly
interpolate between the rendered images whilst scaling up nodes. I
highly doubt users would notice or care about the difference.

-- 
Mark Raynsford | https://www.io7m.com



More information about the openjfx-dev mailing list