freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subpixel offset for glyphs rendering


From: Valerio De Benedetto
Subject: Re: Subpixel offset for glyphs rendering
Date: Sat, 03 Sep 2022 18:01:28 +0000

> Sorry for the late reply.
No problem.

In the meanwhile, I managed to make it work. I'm using
FT_Outline_Translate(), though I'm still not sure if I'm supposed to
pass the translation vector as pixels or font units. For the moment I'm
using pixels, and looks like it's working fine. (To whoever will read
this mail, remember to take into account bitmap_left when translating
outlines, I've lost 3 days wondering why my subpixel positioning was
worse than snapping glyphs to whole pixels!)

Since we are here, I would like to ask you some advice, if you don't mind :)

This is the final result:
https://i.postimg.cc/J7vmztrG/Schermata-del-2022-09-03-19-57-38.png
Environment/settings:
- 96 dpi
- Noto Sans
- FT_LOAD_TARGET_LIGHT | FT_LOAD_FORCE_AUTOHINT
- FT_RENDER_MODE_NORMAL
- 1.4 (faux) gamma correction
- No round()/floor()/ceil() anywhere, except for floor()ing the final x
position of glyphs quads in the vertex shader in order to apply subpixel
positioning

Personally, I think the text looks very good, especially considering I'm
planning to avoid LCD subpixel rendering.
My target is to reach a completely linear layout. I'm very close, some
letters are still jumping around when there is more than 1 emoji on the
same line.

The reason why I added "faux" to gamma correction is that I'm elevating
the final pixel alpha value to (1.0f / 1.4f) in the OpenGL fragment
shader, which is before the pixel is automatically blended with the
background color. Nonetheless, it think it is working good enough, at
least the shapes are not as light and frail as when this correction is
absent.

What do you think of my approach so far? Do you see any room for
improvement?

Thanks again for your time.

Valerio





reply via email to

[Prev in Thread] Current Thread [Next in Thread]