Rounding UI font sizes to integer causes most fonts hard to read without antialiasing #53041

Closed
opened 2017-10-10 12:25:45 +02:00 by Alex P · 6 comments

System Information
Windows 10, Ubuntu 17.10, GTX 1050Ti

Blender Version
2.79, blender.org 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:
non_perfect_fonts.jpg
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:
ui_droid_font.jpg
I've attached both liberation fonts:
LiberationSans-Regular.ttf
LiberationSans-Regular_1.ttf

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

**System Information** Windows 10, Ubuntu 17.10, GTX 1050Ti **Blender Version** 2.79, blender.org 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: ![non_perfect_fonts.jpg](https://archive.blender.org/developer/F995049/non_perfect_fonts.jpg) 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: ![ui_droid_font.jpg](https://archive.blender.org/developer/F995046/ui_droid_font.jpg) I've attached both liberation fonts: [LiberationSans-Regular.ttf](https://archive.blender.org/developer/F995071/LiberationSans-Regular.ttf) [LiberationSans-Regular_1.ttf](https://archive.blender.org/developer/F995072/LiberationSans-Regular_1.ttf) Sidenote: Lack of RGB font antialiasing always make UI font more fuzzy then with antialias turned off.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Alex-9

Added subscriber: @Alex-9

Added subscribers: @JulianEisel, @Sergey

Added subscribers: @JulianEisel, @Sergey
Julian Eisel was assigned by Sergey Sharybin 2017-10-19 14:41:46 +02:00

@JulianEisel is checking whether there is quick fix. But otherwise it's more like a TODO.

@JulianEisel is checking whether there is quick fix. But otherwise it's more like a TODO.
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

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 hinter Freetype auto-hinter
fonthint_liberationsans.png autohint_liberationsans.png

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

Font native hinter Freetype auto-hinter
fonthint_default_font.png autohint_default_font.png
( 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 Font No hinting, Liberation Sans-Regular
nohint_default_font.png nohint_liberationsans.png

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.

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](https://archive.blender.org/developer/F995071/LiberationSans-Regular.ttf)): | Font native hinter | Freetype auto-hinter | ---- | ---- | ![fonthint_liberationsans.png](https://archive.blender.org/developer/F1051772/fonthint_liberationsans.png) | ![autohint_liberationsans.png](https://archive.blender.org/developer/F1052085/autohint_liberationsans.png) Issue is however, it makes the default font look less nicely: | Font native hinter | Freetype auto-hinter | ---- | ---- | ![fonthint_default_font.png](https://archive.blender.org/developer/F1051941/fonthint_default_font.png) | ![autohint_default_font.png](https://archive.blender.org/developer/F1051945/autohint_default_font.png) ( 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 Font | No hinting, Liberation Sans-Regular | ---- | ---- | ![nohint_default_font.png](https://archive.blender.org/developer/F1051965/nohint_default_font.png) | ![nohint_liberationsans.png](https://archive.blender.org/developer/F1051968/nohint_liberationsans.png) 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 ](https://wiki.blender.org/index.php/Dev:Source/Development/Todo/UserInterface#General_todo_items). Will close the report as ToDo. Thanks for reporting nevertheless.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#53041
No description provided.