Rounding UI font sizes to integer causes most fonts hard to read without antialiasing
Closed, InvalidPublic


System Information
Windows 10, Ubuntu 17.10, GTX 1050Ti

Blender Version
2.79, build.
Worked: (optional)

Short description of error
As I use relative small screen I tried to find font that will render pixel-perfect and will be very nice to read. Unfortunately it's really impossible to find one as (most probably) theme font size adjustment doesn't allow precise adjustment of font size - font size is rounded to integer so only 9,10,11 etc are allowed. Take a look @ screenshot:

Left is old Liberation Sans 1.0 font that renders perfectly sharp. Right is new version of font based on Arimo, no way to make it display ok.
Neither "scale" setting nor font size (integer only) allow to display font pixel-perfect sharp. There is also no font hinting adjustment. Letters are always "jagged". There are only few fonts that can display quite ok: Newer Droid sans (better letter spacing), PT Sans, MS Tahoma and old Liberation 1.0

Default UI Droid font seem to have too big letter spaces to read it efficiently:

I've attached both liberation fonts:

Sidenote: Lack of RGB font antialiasing always make UI font more fuzzy then with antialias turned off.


Sergey Sharybin (sergey) triaged this task as Normal priority.Thu, Oct 19, 2:41 PM

@Julian Eisel (Severin) is checking whether there is quick fix. But otherwise it's more like a TODO.

Julian Eisel (Severin) raised the priority of this task from Normal to Confirmed.Thu, Oct 19, 2:48 PM
Julian Eisel (Severin) closed this task as Invalid.EditedThu, Oct 19, 6:37 PM

Hmmm! So tried a few things, mainly related to font hinting. It kinda seems like the hinter of the font fails to produce nice results. Using freetypes auto-hinter looks better. For comparison (using F995071):

Font native hinterFreetype auto-hinter

Issue is however, it makes the default font look less nicely:

Font native hinterFreetype auto-hinter

( Compare characters like 'B' 'R', 'e', 'f'.)
Maybe we could ignore the slight differences, they are quite minor. But I'd also prefer sticking to native font hinting by default, and let freetype fallback to auto-hinting only if the font doesn't support this.

Here is the result of using no hinting at all, not sure if this is any better:

No hinting, Default FontNo hinting, Liberation Sans-Regular
NOTE: All these images are Text Anti-aliasing disabled.

I doubt that this has anything to do with rounding of font sizes though. You'll never get a font size that makes all characters look fine without anti-aliasing and good working hinting, since each has different dimensions. Neither does any sort of RGB anti-aliasing look like it could solve this, from experiments with other apps the difference is hardly noticeable.

I guess the only proper solution could be supporting sub-pixel font bitmaps. That would need further investigation, so would consider this a ToDo really. Added note on our ToDo list.

Will close the report as ToDo. Thanks for reporting nevertheless.