Discussion:
[ft-devel] Something in 2.6.4 broke my windows fonts
Nikolaus Waxweiler
2016-07-07 05:28:37 UTC
Permalink
Hi Nikolaus!
Hi! I've been expecting you :)
I am one of those weird "windows fonts on unix" users. Yeah minority I know,
but recent update completely blew up my setup. So sorry for mailing you out of
blue!
I think everyone with Wine installed has Microsoft's fonts :)
I don't care about ClearType in the slightest, I would just like my Tahoma and
Arial to be pixel perfect crispy as I am used to.
I would also like to push for this to be solved at upstream, as I am
certainly not the only one who is having these problems.
At least some fontconfig option, I can manually define for these few fonts I
depend on, would be helpful.
I don't know of any other way than recompiling. Fontconfig doesn't
support the property and likely won't as it isn't a font-property but
something that affects all TrueType fonts. Cairo/Qt would need to go
along with it, too.

I don't know of a clean way to handle this in FreeType and I frankly
have little interest in bringing the "old" look back to the foreground
as I'm more of a DirectWrite/ClearType person :)

If you really want the pixel look back, your best chance might be
http://bohoomil.com/. That's a patchset on top of FreeType and
fontconfig that aims for configurability. It comes with a pixely Windows
XP preset iirc.
I tried to dig out info on mailing lists, but it is all really complex.
However there was whitelisting proposed for these specific fonts.
Can that be implemented and used to solve the problem?
Whitelist? Where? Keep in mind that FreeType is not the place for
configuration and white/blacklists unless it's critical for rendering
things correctly.
Werner LEMBERG
2016-07-07 06:49:03 UTC
Permalink
I don't care about ClearType in the slightest, I would just like my
Tahoma and Arial to be pixel perfect crispy as I am used to.
I would also like to push for this to be solved at upstream, as I
am certainly not the only one who is having these problems.
At least some fontconfig option, I can manually define for these
few fonts I depend on, would be helpful.
I don't know of any other way than recompiling. Fontconfig doesn't
support the property and likely won't as it isn't a font-property
but something that affects all TrueType fonts. Cairo/Qt would need
to go along with it, too.
I don't know of a clean way to handle this in FreeType and I frankly
have little interest in bringing the "old" look back to the
foreground as I'm more of a DirectWrite/ClearType person :)
Hmm. I can imagine to have (optional) environment variable support in
FreeType to provide default values for font driver properties, e.g.

FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1

What do you think? Due to a linking problem on OS X I have to release
a new FreeType version quite soon, and I could add this rather easily
by implementing a hook into `FT_Init_FreeType' that simply calls
`FT_Property_Set'.

BTW, the next FreeType version will be 2.7.0 (actually, 2.6.4 should
already have been called 2.7.0 due to the new TT hinting engine level).


Werner
Nikolaus Waxweiler
2016-07-07 11:22:31 UTC
Permalink
Well, that would do the job I think. Actually, I think the maintainers of
the Infinality patch set/"fontconfig-ultimate" would love this, they
maintain their own environment variable thing iirc :) Maybe they read this
list. Might contact some later.
Martin "eto" Misuth
2016-07-07 13:02:52 UTC
Permalink
On Thu, 7 Jul 2016 07:28:37 +0200
Post by Nikolaus Waxweiler
Hi! I've been expecting you :)
Heh!
Post by Nikolaus Waxweiler
I think everyone with Wine installed has Microsoft's fonts :)
Well I don't use Wine anymore, and I wanted to make clear enough that this is
"standalone X + toolkits + webfonts" setup. Maybe it affects other such "weird"
combinations in different ways?

Sorry for the poor wording. And for not being clear enough.
Post by Nikolaus Waxweiler
I don't know of any other way than recompiling. Fontconfig doesn't
support the property and likely won't as it isn't a font-property but
something that affects all TrueType fonts. Cairo/Qt would need to go
along with it, too.
Strange thing about this is, that gtk2 program and qt5 program windows don't
explode, and such applications display fonts in window controls normally, but
Gecko engines and some things (yes, I am too lazy check again) do have problems,
indeed.

How come in some of these programs fonts work as expected and somewhere else
they break? Is this fontconfig related somehow, then? How?

I do also understand fontconfig is separate mechanism, and you are telling me
there is no way of this getting solved in "their domain", so to speak?
Post by Nikolaus Waxweiler
Whitelist? Where? Keep in mind that FreeType is not the place for
configuration and white/blacklists unless it's critical for rendering
things correctly.
I was reffering to this email from Werner I found:
http://permalink.gmane.org/gmane.comp.fonts.freetype.devel/10497

And, well it breaks rendering to almost unreadable levels indeed. So I would
say it is kind of "critical".

Lower resolution displays and CRTs are still not the thing of the past yet. One
can hardly find higher quality fonts for situations like that, than those from
Microsoft (unfortunately, open source fonts will probably never reach that
state, now when everybody is jumping hires "retina" bandwagon). This might be
crucial for some users, and I believe they should not be left in the dark,
at least yet.

Webfonts package contains only handful of fonts and most new fonts being hires
LCD "optimized", whitelist could be an effective option.

On Thu, 07 Jul 2016 08:49:03 +0200 (CEST)
Post by Nikolaus Waxweiler
Hmm. I can imagine to have (optional) environment variable support in
FreeType to provide default values for font driver properties, e.g.
FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1
In my opinion this would be great solution (at least for users with "no desktop
environment" and "custom wm/no DE" setups). Such users are usually messing with
envvars anyway. It would be non invasive for most "normal" users whoever they
are, and would allow one to revert to old behaviour dynamically.

Though grepping for getenv() in freetype2 sources, it seems to me, only debug
freetype builds use environment variables at all. More over, all these variables
have 'FT2_' prefix.

Shouldn't thus envvar in question be named 'FT2_PROPERTIES'?

Thank you for consideration, and not dimissing this issue outright.

---

Also, completely unrelated to this:
http://freetype.sourceforge.net/
shows different page than:
https://www.freetype.org/

News there [http://freetype.sourceforge.net/] are stale too.
It would make sense to configure http://freetype.sourceforge.net/ to redirect
to https://www.freetype.org/ and consolidate everything into single resource,
as it makes information discovery quite confusing.

---

eto
Nikolaus Waxweiler
2016-07-07 19:13:12 UTC
Permalink
Post by Martin "eto" Misuth
Well I don't use Wine anymore, and I wanted to make clear enough
that this is "standalone X + toolkits + webfonts" setup. Maybe it
affects other such "weird" combinations in different ways?
All I wanted to say is that "windows fonts on unix" is not a rarity and
perfectly okay :)
Post by Martin "eto" Misuth
Strange thing about this is, that gtk2 program and qt5 program
windows don't explode, and such applications display fonts in window
controls normally, but Gecko engines and some things (yes, I am too
lazy check again) do have problems, indeed.
Basically, fontconfig allows users to set options as they please but it
is up to the application/toolkit that uses fontconfig (GTK/cairo, Qt,
Skia, etc.) to interpret that configuration and instruct FreeType
accordingly. The handling of each toolkit can differ depending on
circumstances. Gecko (cairo) will honor per-font hinting settings, Blink
(Skia) and GTK will not and take additional input from other sources.
Yes, it's messy.

Fontconfig only has properties for things that can be set per-font, the
interpreter version is a TrueType-engine-wide setting. All users of
fontconfig would need to implement handling for that on a per-font-basis
and maybe it's better not to go there...
Post by Martin "eto" Misuth
Post by Nikolaus Waxweiler
Whitelist? Where? Keep in mind that FreeType is not the place for
configuration and white/blacklists unless it's critical for
rendering things correctly.
http://permalink.gmane.org/gmane.comp.fonts.freetype.devel/10497
Ah, yes, I scrapped that idea because I wanted to see how far I could go
without special-casing fonts except tricky and native ClearType ones.
Very far it turns out. The current code does not have any
white-/blacklisting.
Post by Martin "eto" Misuth
And, well it breaks rendering to almost unreadable levels indeed. So
I would say it is kind of "critical".
That's because your brain is used to something different. I find the
"old" look horrible, you the new one. It's a matter of getting used to
something. The new look has the objective advantage that different fonts
render much more harmoniously even when the hinting is shoddy by
discarding an entire axis that happens to be important for horizontal
text like what you're reading right now. That's why I think it's the
objectively better choice for a default.
Post by Martin "eto" Misuth
Lower resolution displays and CRTs are still not the thing of the
past yet. One can hardly find higher quality fonts for situations
like that, than those from Microsoft (unfortunately, open source
fonts will probably never reach that state, now when everybody is
jumping hires "retina" bandwagon). This might be crucial for some
users, and I believe they should not be left in the dark, at least
yet.
Webfonts package contains only handful of fonts and most new fonts
being hires LCD "optimized", whitelist could be an effective option.
I think you're conflating several things here, FreeType's rendition of
Microsoft's core web fonts with the new v40 code is *very* similar to
how they are rendered by DirectWrite on Windows, HiDPI or not. Keep in
mind that millions of Windows users are exposed to a very similar
rendering every day on crappy low-resolution displays and can read it
fine. Internet Explorer, Edge and Chrome all use DirectWrite to render
fonts by default, only Firefox uses GDI for several fonts on an internal
whitelist. Ubuntu employs a similar look and is the most visible Linux
distribution.

What you mean is, you want GDI-like rendering of fonts that were
instructed for clean black-and-white display. Think Windows 95+ and XP.
That's what the previously default v35 code did, but *only* when the
font was hinted accordingly. Read: Microsoft's core web fonts and the
DejaVu (+ antialiasing) and Ubuntu family.

Font hinting is an extremely confusing and messy topic.
Werner LEMBERG
2016-07-07 19:37:04 UTC
Permalink
Post by Martin "eto" Misuth
Post by Nikolaus Waxweiler
I don't know of any other way than recompiling. Fontconfig doesn't
support the property and likely won't as it isn't a font-property
but something that affects all TrueType fonts. Cairo/Qt would need
to go along with it, too.
Strange thing about this is, that gtk2 program and qt5 program
windows don't explode, [...]
They probably use a statically linked FreeType library.
Post by Martin "eto" Misuth
I do also understand fontconfig is separate mechanism, and you are
telling me there is no way of this getting solved in "their domain",
so to speak?
Correct. Fontconfig's job is *not* to define or set up the rendering
of a font but to provide information on fonts and what capabilities
they have.
Post by Martin "eto" Misuth
Post by Nikolaus Waxweiler
FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1
In my opinion this would be great solution
OK, will try that soon.
Post by Martin "eto" Misuth
Shouldn't thus envvar in question be named 'FT2_PROPERTIES'?
Maybe, but `FREETYPE' is more meaningful than `FT2' for the common
man, I guess :-)


Werner
Jan Alexander Steffens
2016-07-07 19:50:14 UTC
Permalink
Post by Werner LEMBERG
Post by Martin "eto" Misuth
Shouldn't thus envvar in question be named 'FT2_PROPERTIES'?
Maybe, but `FREETYPE' is more meaningful than `FT2' for the common
man, I guess :-)
For the record, I did some evil downstream patchery and introduced
FT2_SUBPIXEL_HINTING a few versions ago, recently extended for 2.6.4:

https://git.archlinux.org/svntogit/packages.git/tree/trunk/0003-Make-subpixel-hinting-mode-configurable.patch?h=packages/freetype2
Werner LEMBERG
2016-07-11 23:16:52 UTC
Permalink
Post by Jan Alexander Steffens
For the record, I did some evil downstream patchery and introduced
FT2_SUBPIXEL_HINTING a few versions ago, recently extended for
https://git.archlinux.org/svntogit/packages.git/tree/trunk/0003-Make-subpixel-hinting-mode-configurable.patch?h=packages/freetype2
With my just added code, you can now say e.g.

FREETYPE_PROPERTIES=truetype:interpreter-version=38


Werner

Werner LEMBERG
2016-07-11 13:14:34 UTC
Permalink
Post by Werner LEMBERG
Post by Martin "eto" Misuth
Post by Werner LEMBERG
FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1
In my opinion this would be great solution
OK, will try that soon.
This is now implemented in the git repository, please test!


Werner
Alexei Podtelezhnikov
2016-07-07 13:25:45 UTC
Permalink
Post by Werner LEMBERG
BTW, the next FreeType version will be 2.7.0 (actually, 2.6.4 should
already have been called 2.7.0 due to the new TT hinting engine level).
Are you going to enable subpixel rendering by default as well?
Werner LEMBERG
2016-07-07 13:45:00 UTC
Permalink
Post by Alexei Podtelezhnikov
Post by Werner LEMBERG
BTW, the next FreeType version will be 2.7.0 (actually, 2.6.4
should already have been called 2.7.0 due to the new TT hinting
engine level).
Are you going to enable subpixel rendering by default as well?
You mean FT_CONFIG_OPTION_SUBPIXEL_RENDERING? No. It's still
patented stuff, AFAIK.


Werner
Nikolaus Waxweiler
2016-07-07 19:24:49 UTC
Permalink
Post by Werner LEMBERG
Post by Alexei Podtelezhnikov
Are you going to enable subpixel rendering by default as well?
You mean FT_CONFIG_OPTION_SUBPIXEL_RENDERING? No. It's still
patented stuff, AFAIK.
Until mid-2018 I think?
Werner LEMBERG
2016-07-07 19:32:43 UTC
Permalink
Post by Nikolaus Waxweiler
Post by Werner LEMBERG
Post by Alexei Podtelezhnikov
Are you going to enable subpixel rendering by default as well?
You mean FT_CONFIG_OPTION_SUBPIXEL_RENDERING? No. It's still
patented stuff, AFAIK.
Until mid-2018 I think?
Really? I have no idea :-)


Werner
Alexei Podtelezhnikov
2016-07-07 19:36:52 UTC
Permalink
Post by Nikolaus Waxweiler
Post by Werner LEMBERG
Post by Alexei Podtelezhnikov
Are you going to enable subpixel rendering by default as well?
You mean FT_CONFIG_OPTION_SUBPIXEL_RENDERING? No. It's still
patented stuff, AFAIK.
Until mid-2018 I think?
The latest filing date was Oct 7 1999. Plus 20 years.
Continue reading on narkive:
Loading...