unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: James Cloos <cloos@jhcloos.com>
Cc: 17792@debbugs.gnu.org
Subject: bug#17792: 24.3; hintstyle spewcified via fontconfig is ignored by Emacs
Date: Wed, 25 Jun 2014 10:32:16 +0200	[thread overview]
Message-ID: <A0A32C4D-14F9-4BD3-B575-E3E24E79D4B2@swipnet.se> (raw)
In-Reply-To: <m338euarva.fsf@carbon.jhcloos.org>

Hello.

25 jun 2014 kl. 00:01 skrev James Cloos <cloos@jhcloos.com>:

>>>>>> "JD" == Jan Djärv <jan.h.d@swipnet.se> 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.

Thanks for the clarification.

> 
> 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.


Emacs does have the ftx font backend that gets compiled if libXft is not present.
Unfortunately it seems a bit broken w.r.t. sizes (all fonts are too large), and also the Gtk+ code in Emacs assumes Xft.  Both of these could be fixed, and we could offer both backends.

Ftx does not use XRENDER btw, so I suspect it might be a bit slow.
Another approach would be to add a draw method to the Ft backend.  Currently it is just common code for Xft and ftx.

But it seems excessive to work around something that can be made to work anyway.

	Jan D.






  reply	other threads:[~2014-06-25  8:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <53A70B0B.3050300@swipnet.se>
2014-06-17  3:08 ` bug#17792: 24.3; hintstyle specified via fontconfig is ignored by Emacs yynyygy
2014-06-17 15:28   ` Jan Djärv
2014-06-18  4:44     ` Fangwen Yu
2014-06-22 20:54   ` bug#17792: 24.3; hintstyle spewcified " Jan Djärv
2014-06-24 22:01     ` James Cloos
2014-06-25  8:32       ` Jan Djärv [this message]
2019-09-26 14:10   ` bug#17792: 24.3; hintstyle specified " Stefan Kangas
2020-08-12 18:50     ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A0A32C4D-14F9-4BD3-B575-E3E24E79D4B2@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=17792@debbugs.gnu.org \
    --cc=cloos@jhcloos.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).