
The new TrueType interpreter in FreeType 2.7.0 - rbanffy
http://lists.nongnu.org/archive/html/freetype-devel/2016-07/msg00091.html
======
mrob
"Switching to the new mode might take some getting used to though, so if you
think your fonts are suddenly fat, fuzzy or weird, give your brain some time
to adjust."

This is true, and IMO it's the reason font rendering is much less important
than people think. When I got a new pair of glasses I disabled font anti-
aliasing to make the edges as sharp as possible. I did this so I could more
quickly learn to focus my eyes correctly with the new glasses. By the time I
had mastered the glasses I was used to the font rendering, and I have not
switched it back. I now prefer fonts with no anti-aliasing. If you'd told me
in the past that I'd end up preferring that I might not have believed it.

The most legible font is the one you're used to. People can read Blackletter
or Spencerian like it's a normal font if they're used to it. I think vector
fonts were a mistake. It's a lot of software complexity for very little value.

~~~
zbuf
> The most legible font is the one you're used to.

Yes, and in my case on Linux I switched off hinting a long time ago (but
retained anti-aliasing)

We even did it on our network at work by default as users liked the fonts when
they were more "Mac like".

Personally I have never understood the whole font hinting thing. It seems
rather unscientific and the result is that fonts look fundamentally different
at slight size differences; seems hinting is part of the problem, not the
solution.

~~~
JoshTriplett
> Personally I have never understood the whole font hinting thing. It seems
> rather unscientific and the result is that fonts look fundamentally
> different at slight size differences; seems hinting is part of the problem,
> not the solution.

Hinting exists because displays don't have infinite resolution. Mac-style
rendering has always acted like displays have paper-like resolutions, and
respects a font's letter shapes more, favoring the original designer's
intended font appearance on paper. Windows-style rendering has always
acknowledged that displays have pixels, and that smearing fonts across pixels
can decrease readability on average-DPI displays. Linux font rendering has
historically offered a choice between the two, but typically defaulted to
Windows-style rendering.

------
damptowel
Must-read regarding smoothing and hinting:
[http://www.antigrain.com/research/font_rasterization/index.h...](http://www.antigrain.com/research/font_rasterization/index.html)

~~~
vanderZwan
The world of font rendering lost a great developer when Maxim Shemanarev
passed away.

------
captainmuon
Oh no, why would they do this? You could already achieve something similar
(and superior IMO) with the old FreeType by enabling "loose hinting" (ignoring
hinting in x-direction) and using RGBA subpixel hinting. Ignoring horizontal
hinting only really works when you have subpixel hinting, because of the
~tripled horizontal resolution.

I don't understand why anybody (MS, the FreeType devs, ...) would choose
DirectWrite style rendering. It just looks blurry to me. Even on a hidpi
display, where it shouldn't make a difference, it looks wierd compared to GDI
rendering. One major reason I don't like Edge, and also find Metro and XAML
apps somehow yucky (just a gut reaction, I'm not judging them technically).

~~~
mark-r
Some people really dislike subpixel rendering.

------
Longhanks
What? As someone who hates Windows' Font rendering, why would you want this?

The OS X font rendering is awesome, on Linux, Infinality can be tweaked to
look even better, but windows? It's hideous, inconsistent and terrible to
change...

~~~
mikekchar
I agree with that assessment (although I think OS X font render has problems
as well). I'm a bit worried because now Infinality is removed from the code
base by default, so I suspect I'm going to have to stick to customer builds to
get the font rendering that I prefer.

I suffer from ocular migraines and as hard as it is to believe (even for me),
the way fonts are rendered makes a difference. I will literally go blind
looking at badly rendered fonts. I'm going to take a wait and see attitude,
though. Not all fonts will be affected, so perhaps it will be OK.

~~~
adambrod
Have you tried a retina display? I find that the higher DPI panel reduces my
eye strain.

~~~
mikekchar
Yeah. I have the most bizarre setup up. I have a 13.3" display (with about 165
DPI), so not retinal, but still relatively high resolution. Anything bigger
than this seems to trigger my migraines. I'm really waiting for the day when I
can get 30 fps on an e-ink display. Something about staring into the light
seems to be a problem. But low contrast is also a huge problem. So I usually
have my backlight set at around 10% (!!) and my colour themes are set so that
you would think that I subscribe to the clown school of programming.
Everything is done in a 16 colour console with a 25 point font. You have no
idea how many hours I've spent comparing the contrast ratios of various 16
colour schemes. All I can say is that it's a good thing that I come from a
time where 80x25 column terminals were state of the art ;-)

I'm considering moving to very large wall mounted TV and sitting far enough
away so that the display angle of the screen is about the same as my 13.3"
laptop. Unfortunately, I don't have the ability to wall mount a TV in my
current apartment, so it may have to wait until I buy a house (I bet the e-ink
display comes first ;-) )

------
Quppa
Meanwhile Microsoft has basically given up on sub-pixel smoothing: it's
missing from Windows Store/Modern/Metro apps (including Edge) and IE10 and
newer and is mostly absent from Office 2013 and newer when running on Windows
8 and above†. More's the pity - not all of us have high DPI screens yet.

† [https://www.quppa.net/blog/2012/07/17/office-2013-further-
ev...](https://www.quppa.net/blog/2012/07/17/office-2013-further-evidence-of-
the-demise-of-cleartype/)

~~~
ghusbands
I believe part of the reason is that it was never fully compatible with screen
rotation, often still assuming RGB order from text-left to text-right. Another
part would be that the world is moving towards much higher resolution
displays, where the effect of subpixel rendering is negligible.

~~~
Quppa
It's a combination of what you mentioned and incompatibility with APIs like
Direct Manipulation. Raymond Chen explains it here:
[https://blogs.msdn.microsoft.com/oldnewthing/20150129-00/?p=...](https://blogs.msdn.microsoft.com/oldnewthing/20150129-00/?p=44803)

------
thristian
Man, all these years I assumed FreeType's "slight" hinting setting was
secretly the 'ignore horizontal hinting' option.

~~~
edwintorok
Yes, IIUC [https://www.freetype.org/freetype2/docs/text-rendering-
gener...](https://www.freetype.org/freetype2/docs/text-rendering-general.html)
the difference is what provides the vertical hinting:

FreeType < 2.6.2 hint=slight: use auto-hinter for vertical hinting

FreeType 2.6.2+ hint=slight: use native "vertical-grid-only-snapping" for
OpenType/CFF, fallback to autohinter "vertical-grid-only"

FreeType 2.7.0 v40 default: support TrueType too for native "vertical-grid-
only-snapping", and enable this by default (regardless if hint is set to
slight or not?)

------
mschuster91
Finally. To be honest I switched back to using Windows on my private machine
because font rendering on Linux (using Chromium and Firefox) was more like a
lottery than something readable without enough alcohol.

A pity it will take some time to ship to Debian Testing, I'd love to try it
without having to recompile the whole system.

~~~
augustk
What Linux distribution did you use? In my experience the font rendering in
the common distributions, like Ubuntu, is rather good these days. Personally I
use Debian stable with a simple window manager (Blackbox) and no X display
manager. In this case I need to set a few variables in ~/.Xresources to get
good results:

    
    
        Xft.antialias: true
        Xft.autohint: false
        Xft.dpi: 100
        Xft.hinting: true
        Xft.hintstyle: hintslight
        Xft.lcdfilter: lcddefault
        Xft.rgba: rgb

~~~
gdamjan1
most modern apps use fontconfig to, well, configure fonts, and afaik ignore
these Xft X resources.

So something like this is needed in ~/.config/fontconfig/fonts.conf:

    
    
      <?xml version='1.0'?>
      <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
      <fontconfig>
      <match target="font">
      <edit mode="assign" name="rgba"><const>rgb</const></edit>
      <edit mode="assign" name="hinting"><bool>true</bool></edit>
      <edit mode="assign" name="hintstyle"><const>hintfull</const></edit>
      <edit mode="assign" name="antialias"><bool>true</bool></edit>
      <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
      </match>
      </fontconfig>

------
kasabali
This is fantastic news. FreeType rendering was already pretty good for common
FOSS fonts in the recent versions unless the distribution crippled it, but a
pet peeve of mine was that Microsoft fonts have never seemed quite right (as
demonstrated by the OP in
[https://s31.postimg.org/t5trkfd2x/freetype_264_consolas_v35_...](https://s31.postimg.org/t5trkfd2x/freetype_264_consolas_v35_v40.png)).

KUDOS to all contributors, especially for the last few release of FreeType
which really rocked!

------
be5invis
Autohinting is hard, especially for ideographs. My hinter even used
differential evolution to calculate how strokes should be placed. (link:
github.com/be5invis/sfdhanautohint)

~~~
DonHopkins
In the future, somebody will develop an AI-based auto-hinter that's so good it
makes Comic Sans look like Helvetica.

------
wooptoo
Subpixel hinting mode can be chosen by setting the right value in your
environment, for example /etc/environment or ~/.pam_environment

Available settings:

    
    
          FT2_SUBPIXEL_HINTING=0  # Classic mode (default in 2.6)
          FT2_SUBPIXEL_HINTING=1  # Infinality mode
          FT2_SUBPIXEL_HINTING=2  # Minimal mode (default in 2.7)

------
Esau
FreeType is not "Linux" software but "UNIX" software. I don't understand why
this keeps happening.

~~~
honkhonkpants
A randomly selected unix system has a 99.999% chance of being a Linux system.
Nobody cares about the other variants except for their own developers and a
few historians and hobbyists.

For that matter I have no idea why you think freetype is even unix software.
It builds and runs on numerous non-unix platforms.

~~~
derefr
A randomly-selected UNIX _workstation_ has a pretty high chance of being an
OSX system, I'd think. UNIX servers are 99.999% Linux, though, yes.

~~~
farva
Surely *BSD accounts for more than 0.0001% of UNIX-like servers.

------
ghusbands
In the announcement, they explicitly state that the performance changes will
make Arial and other very common fonts render less well. Is this a sound
decision, in an age where these fonts are still very widely explicitly used?

~~~
atemerev
Arial looks ugly no matter what rendering hacks you apply. The sooner it will
be extinct the better.

------
mixmastamyk
Linux has had subpixel rendering for years now. What does this mean, better
hinting?

------
amelius
Can somebody explain this to me? In low resolutions, you can easily, with
current memory sizes and bandwidths, store all the fonts in pixel format
(compressed of course). At high resolutions, you don't need any hinting, so
you can just render the font as svg paths for example.

So why do we still need an interpreter?

~~~
ghusbands
If you use a particular version of each letter at each size, you start to
accumulate positioning error as you go along a line (or end up with odd gaps
if you try to avoid it). Nowadays, we tend to aim for precise reproduction of
the font's sizing, even where the size ends up not being a round number of
pixels, for consistency. You'd then need at least 16 versions of each letter
to approximately cover each subpixel position, and it starts not really being
a win.

~~~
amelius
True, but at least the artist has complete control.

------
vaibhavkul
Does this mean that now Java-based GUI software (e.g. Android Studio) run
using OpenJDK will display much better fonts?

~~~
kasabali
No, not at all. The problem was never on FreeType side, it was always on Java
side.

Recent versions of IntelliJ are bundled with a patched version of OpenJDK
though, so that particular case should not be a problem anymore.

------
boondaburrah
No. No stop. I install MacType, which hacks windows's font rendering and
replaces it with freetype, SPECIFICALLY so I can /avoid/ cleartype's ugly
rendering on windows. I don't want it to invade my linux/mac as well!

~~~
strcat
It's not a mandatory feature. It provides options that it didn't have before
without having lost anything.

~~~
orivej
Nikolaus Waxweiler writes in the announcement that he was led "to strip the
v38 Infinality code to the bare minimum and remove all configurability in the
name of speed and simplicity".

~~~
strcat
There were 2 interpreters before. Now there are 3. You're misunderstanding the
announcement. Regardless, the Infinality interpreter is the closest to Windows
rendering so it isn't what the OP wants. In all likelihood they want hinting
disabled if they want it to be like OS X... so this stuff isn't relevant at
all.

------
supermatou
Direct link to the announcement:
[http://lists.nongnu.org/archive/html/freetype-
devel/2016-07/...](http://lists.nongnu.org/archive/html/freetype-
devel/2016-07/msg00091.html) (includes images with the old/new renderings)

~~~
agumonkey
Impressive. Serious kudos to all involved.

~~~
1ris
Pardon my ignorance, but for me these look different, of course, but i have no
idea which one looks best.

~~~
agumonkey
I meant more about revamping an easy to forget piece of IO infrastructure that
is far from trivial.

