Subject: bug#17792: 24.3; hintstyle spewcified via fontconfig is ignored by Emacs

From: James Cloos <[email-masked]>
Date: Tue, 24 Jun 2014 18:01:52 -0400

>>>>> "JD" == Jan Djärv <[email-masked]> writes:

JD> I don't know if cairo itself reads fonts.conf and/or X resources,
JD> but I suspect it does.

No.  It uses the fontconfig api.

This bug is a side effect of using xft to render fonts.  LibXft has a
routine which edits the font pattern before passing on to libfontconfig;
it adds pattern elements for each of:

  antialias autohint dpi embolden hinting hintstyle lcdfilter
  maxglyphmemory maxunreffonts minspace render rgba scale

based on what it finds in the X Resources.

It always adds a pattern entry for each of those, with a default value
if it doesn't find an explicit X resource.

Fontconfig is written to allow applications to override the default
values specified in/via fonts.conf, on the reasonable theories that users
should be able to tell apps to override them, and that some applications
SHOULD avoid things like hinting, and therefore need a way to do that.

By forcing its own set of defaults, xft blocks any ability to set those
via the xml.

Fixing this will either require changing libxft to avoid adding pattern
elements for which explicit X Resources do not exist, or changing Emacs
to use fontconfig, freetype and XRENDER directly, rather than via xft.

Handa-san's original code supported an fc: prefix for fonts, which was
defined to do the above, but the xft: won out.

-JimC
-- 
James Cloos <[email-masked]>         OpenPGP: 0x997A9F17ED7DAEA6