GNU bug report logs - #79090
Respects Fontconfig settings for ftcr and ftcrhb font backends

Previous Next

Package: emacs;

Reported by: Mike <mikeandmore <at> gmail.com>

Date: Fri, 25 Jul 2025 06:16:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 79090 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Fri, 25 Jul 2025 06:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike <mikeandmore <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 25 Jul 2025 06:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Respects Fontconfig settings for ftcr and ftcrhb font backends
Date: Thu, 24 Jul 2025 21:12:36 -0400
[Message part 1 (text/plain, inline)]
Tags: patch

The ftcr and ftcrhb backends use cairo to render fonts, but cairo does
not respect font specific fontconfig settings. This patch queries
fontconfig with the specific font, and then it translates the fontconfig
settings into cairo font settings.

Both backends would also ignore :hinting and :autohint properties from
the font-spec. This patch fixes that too.

In GNU Emacs 30.1 (build 1, x86_64-redhat-linux-gnu) of 2025-05-25 built
 on 02c108121fcd
System Description: Oracle Linux Server 9.4

Configured using:
 'configure --without-all --without-x --without-ns
 --with-compress-install --with-modules --with-sqlite3=yes
 --with-zlib=yes --with-threads=yes --with-modules=yes
 --with-file-notification=inotify
 --srcdir=/ports/editors/emacs30-nox11/work/emacs-30.1
 --localstatedir=/pkg/var --disable-autodepend --prefix=/pkg
 --build=x86_64-redhat-linux --host=x86_64-redhat-linux
 --infodir=/pkg/info --mandir=/pkg/man --enable-option-checking=yes
 'CFLAGS=-O2 -O3 -march=ivybridge -I/usr/include -I/pkg/include'
 'CPPFLAGS=-I/usr/include -I/pkg/include'
 'LDFLAGS=-L/pkg/gcc14/lib/gcc/x86_64-redhat-linux/14.2.0
 -Wl,-R/pkg/gcc14/lib/gcc/x86_64-redhat-linux/14.2.0 -L/pkg/gcc14/lib64
 -Wl,-R/pkg/gcc14/lib64 -L/usr/lib64 -Wl,-R/usr/lib64 -L/pkg/lib
 -Wl,-R/pkg/lib''

-- 
Thanks
Mike
[Message part 2 (text/html, inline)]
[emacs-fc-hinting.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Fri, 25 Jul 2025 07:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mike <mikeandmore <at> gmail.com>, Po Lu <luangruo <at> yahoo.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Fri, 25 Jul 2025 10:34:03 +0300
> From: Mike <mikeandmore <at> gmail.com>
> Date: Thu, 24 Jul 2025 21:12:36 -0400
> 
> The ftcr and ftcrhb backends use cairo to render fonts, but cairo does
> not respect font specific fontconfig settings. This patch queries
> fontconfig with the specific font, and then it translates the fontconfig
> settings into cairo font settings.
> 
> Both backends would also ignore :hinting and :autohint properties from
> the font-spec. This patch fixes that too.

Thanks.

I don't use Fontconfig and Cairo, so someone else who does will need
to review the patch and try it.  Would you please post a procedure to
test this patch once applied?

Also, I wonder if this will have any user-level effects, and if so,
should we have a NEWS entry about that?

And finally, to accept changes of this size, we will need you to sign
a copyright-assignment agreement with FSF.  If you are willing to do
that, I will send you the form to fill and the instructions to go with
it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 30 Jul 2025 23:31:02 GMT) Full text and rfc822 format available.

Message #11 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Po Lu <luangruo <at> yahoo.com>, 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Wed, 30 Jul 2025 19:30:17 -0400
[Message part 1 (text/plain, inline)]
Hi

Here's how I tested this.

1. I have the following base settings in fontconfig. They disable hinting
and autohint, so that Freetype will preserve the font shapes when rendering
web fonts.

  <match target="pattern">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
    <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>false</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
  </match>

2. Enable hinting for specific local fonts so that I can use them inside
Emacs with a smaller font size.

  <match target="font">
    <test name="family"><string>Hack</string></test>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
  </match>

For this step, you can also enable hinting in font-spec under Emacs.

Here are the screenshots. They are taken on a HiDPI display, and I'm going
to retake them tomorrow at work where we have low DPI displays.

Thanks
Mike


On Fri, Jul 25, 2025 at 3:34 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Mike <mikeandmore <at> gmail.com>
> > Date: Thu, 24 Jul 2025 21:12:36 -0400
> >
> > The ftcr and ftcrhb backends use cairo to render fonts, but cairo does
> > not respect font specific fontconfig settings. This patch queries
> > fontconfig with the specific font, and then it translates the fontconfig
> > settings into cairo font settings.
> >
> > Both backends would also ignore :hinting and :autohint properties from
> > the font-spec. This patch fixes that too.
>
> Thanks.
>
> I don't use Fontconfig and Cairo, so someone else who does will need
> to review the patch and try it.  Would you please post a procedure to
> test this patch once applied?
>
> Also, I wonder if this will have any user-level effects, and if so,
> should we have a NEWS entry about that?
>
> And finally, to accept changes of this size, we will need you to sign
> a copyright-assignment agreement with FSF.  If you are willing to do
> that, I will send you the form to fill and the instructions to go with
> it.
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]
[screenshot-20250730-183722.png (image/png, attachment)]
[screenshot-20250730-183731.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Sat, 30 Aug 2025 07:19:02 GMT) Full text and rfc822 format available.

Message #14 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com, Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Sat, 30 Aug 2025 10:18:23 +0300
Po Lu, would you please review the proposed patch and the testing
information, and advise how to proceed with this issue?

> From: Mike <mikeandmore <at> gmail.com>
> Date: Wed, 30 Jul 2025 19:30:17 -0400
> Cc: Po Lu <luangruo <at> yahoo.com>, 79090 <at> debbugs.gnu.org
> 
> Here's how I tested this.
> 
> 1. I have the following base settings in fontconfig. They disable hinting and autohint, so that Freetype will
> preserve the font shapes when rendering web fonts.
> 
>   <match target="pattern">
>     <edit name="antialias" mode="assign"><bool>true</bool></edit>
>     <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
>     <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
>     <edit name="hinting" mode="assign"><bool>false</bool></edit>
>     <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
>     <edit name="rgba" mode="assign"><const>rgb</const></edit>
>     <edit name="autohint" mode="assign"><bool>false</bool></edit>
>     <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
>   </match>
> 
> 2. Enable hinting for specific local fonts so that I can use them inside Emacs with a smaller font size.
> 
>   <match target="font">
>     <test name="family"><string>Hack</string></test>
>     <edit name="hinting" mode="assign"><bool>true</bool></edit>
>     <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
>   </match>
> 
> For this step, you can also enable hinting in font-spec under Emacs. 
> 
> Here are the screenshots. They are taken on a HiDPI display, and I'm going to retake them tomorrow at work
> where we have low DPI displays.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Sat, 13 Sep 2025 07:48:03 GMT) Full text and rfc822 format available.

Message #17 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com
Cc: 79090 <at> debbugs.gnu.org, mikeandmore <at> gmail.com
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Sat, 13 Sep 2025 10:47:39 +0300
Ping!  Po Lu, could you please chime in?

> Cc: 79090 <at> debbugs.gnu.org
> Date: Sat, 30 Aug 2025 10:18:23 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> Po Lu, would you please review the proposed patch and the testing
> information, and advise how to proceed with this issue?
> 
> > From: Mike <mikeandmore <at> gmail.com>
> > Date: Wed, 30 Jul 2025 19:30:17 -0400
> > Cc: Po Lu <luangruo <at> yahoo.com>, 79090 <at> debbugs.gnu.org
> > 
> > Here's how I tested this.
> > 
> > 1. I have the following base settings in fontconfig. They disable hinting and autohint, so that Freetype will
> > preserve the font shapes when rendering web fonts.
> > 
> >   <match target="pattern">
> >     <edit name="antialias" mode="assign"><bool>true</bool></edit>
> >     <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
> >     <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
> >     <edit name="hinting" mode="assign"><bool>false</bool></edit>
> >     <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
> >     <edit name="rgba" mode="assign"><const>rgb</const></edit>
> >     <edit name="autohint" mode="assign"><bool>false</bool></edit>
> >     <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
> >   </match>
> > 
> > 2. Enable hinting for specific local fonts so that I can use them inside Emacs with a smaller font size.
> > 
> >   <match target="font">
> >     <test name="family"><string>Hack</string></test>
> >     <edit name="hinting" mode="assign"><bool>true</bool></edit>
> >     <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
> >   </match>
> > 
> > For this step, you can also enable hinting in font-spec under Emacs. 
> > 
> > Here are the screenshots. They are taken on a HiDPI display, and I'm going to retake them tomorrow at work
> > where we have low DPI displays.
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Sat, 27 Sep 2025 08:52:02 GMT) Full text and rfc822 format available.

Message #20 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com
Cc: 79090 <at> debbugs.gnu.org, mikeandmore <at> gmail.com
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Sat, 27 Sep 2025 11:51:20 +0300
Ping! Ping!  Po Lu, please respond.

> Cc: 79090 <at> debbugs.gnu.org, mikeandmore <at> gmail.com
> Date: Sat, 13 Sep 2025 10:47:39 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> Ping!  Po Lu, could you please chime in?
> 
> > Cc: 79090 <at> debbugs.gnu.org
> > Date: Sat, 30 Aug 2025 10:18:23 +0300
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > 
> > Po Lu, would you please review the proposed patch and the testing
> > information, and advise how to proceed with this issue?
> > 
> > > From: Mike <mikeandmore <at> gmail.com>
> > > Date: Wed, 30 Jul 2025 19:30:17 -0400
> > > Cc: Po Lu <luangruo <at> yahoo.com>, 79090 <at> debbugs.gnu.org
> > > 
> > > Here's how I tested this.
> > > 
> > > 1. I have the following base settings in fontconfig. They disable hinting and autohint, so that Freetype will
> > > preserve the font shapes when rendering web fonts.
> > > 
> > >   <match target="pattern">
> > >     <edit name="antialias" mode="assign"><bool>true</bool></edit>
> > >     <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
> > >     <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
> > >     <edit name="hinting" mode="assign"><bool>false</bool></edit>
> > >     <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
> > >     <edit name="rgba" mode="assign"><const>rgb</const></edit>
> > >     <edit name="autohint" mode="assign"><bool>false</bool></edit>
> > >     <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
> > >   </match>
> > > 
> > > 2. Enable hinting for specific local fonts so that I can use them inside Emacs with a smaller font size.
> > > 
> > >   <match target="font">
> > >     <test name="family"><string>Hack</string></test>
> > >     <edit name="hinting" mode="assign"><bool>true</bool></edit>
> > >     <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
> > >   </match>
> > > 
> > > For this step, you can also enable hinting in font-spec under Emacs. 
> > > 
> > > Here are the screenshots. They are taken on a HiDPI display, and I'm going to retake them tomorrow at work
> > > where we have low DPI displays.
> > 
> > 
> > 
> > 
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Tue, 30 Sep 2025 07:27:02 GMT) Full text and rfc822 format available.

Message #23 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb
 font backends
Date: Tue, 30 Sep 2025 09:26:17 +0200
Mike <mikeandmore <at> gmail.com> writes:

> Tags: patch
>
> The ftcr and ftcrhb backends use cairo to render fonts, but cairo does
> not respect font specific fontconfig settings. This patch queries
> fontconfig with the specific font, and then it translates the fontconfig
> settings into cairo font settings.
>
> Both backends would also ignore :hinting and :autohint properties from
> the font-spec. This patch fixes that too.

Hi,

I'd like to give a try but do you have a recipe that shows something
that doesn't work without your patch and works with?
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Tue, 30 Sep 2025 20:46:01 GMT) Full text and rfc822 format available.

Message #26 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Tue, 30 Sep 2025 16:44:43 -0400
[Message part 1 (text/plain, inline)]
Hi

You'll need the X11 backend running on a low pixel density display. Then
with my patch, you should see the difference between:

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting t
:size 10))

and

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
nil :size 10))

Here are the screenshots.

Thanks
Mike


On Tue, Sep 30, 2025 at 3:26 AM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:

> Mike <mikeandmore <at> gmail.com> writes:
>
> > Tags: patch
> >
> > The ftcr and ftcrhb backends use cairo to render fonts, but cairo does
> > not respect font specific fontconfig settings. This patch queries
> > fontconfig with the specific font, and then it translates the fontconfig
> > settings into cairo font settings.
> >
> > Both backends would also ignore :hinting and :autohint properties from
> > the font-spec. This patch fixes that too.
>
> Hi,
>
> I'd like to give a try but do you have a recipe that shows something
> that doesn't work without your patch and works with?
> --
> Manuel Giraud
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]
[screenshot-20250930-163946.png (image/png, attachment)]
[screenshot-20250930-163958.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 01 Oct 2025 07:32:02 GMT) Full text and rfc822 format available.

Message #29 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb
 font backends
Date: Wed, 01 Oct 2025 09:31:27 +0200
[Message part 1 (text/plain, inline)]
Mike <mikeandmore <at> gmail.com> writes:

> Hi
>
> You'll need the X11 backend running on a low pixel density display. Then
> with my patch, you should see the difference between:
>
> (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting t
> :size 10))
>
> and
>
> (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
> nil :size 10))
>
> Here are the screenshots.

Hi,

I've tested this recipe on 30.2 *without* your patch and I can already
see a difference between without or with hinting:

[30.2-hinting-nil.png (image/png, inline)]
[30.2-hinting-t.png (image/png, inline)]
[Message part 4 (text/plain, inline)]
Calling (frame-parameter nil 'font-backend) returns (ftcrhb x).
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 01 Oct 2025 14:25:02 GMT) Full text and rfc822 format available.

Message #32 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Wed, 1 Oct 2025 10:23:31 -0400
[Message part 1 (text/plain, inline)]
Hi

Thanks for the help!

Hmm, I think you do not have font settings for the global pattern. Can you
try the following in your fonts.conf?

  <match target="pattern">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
    <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>false</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
  </match>

This will affect how fonts are rendered system wide.

Thanks
Mike

On Wed, Oct 1, 2025 at 3:31 AM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:

> Mike <mikeandmore <at> gmail.com> writes:
>
> > Hi
> >
> > You'll need the X11 backend running on a low pixel density display. Then
> > with my patch, you should see the difference between:
> >
> > (set-face-attribute 'default nil :font (font-spec :family "Hack"
> :hinting t
> > :size 10))
> >
> > and
> >
> > (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
> > nil :size 10))
> >
> > Here are the screenshots.
>
> Hi,
>
> I've tested this recipe on 30.2 *without* your patch and I can already
> see a difference between without or with hinting:
>
>
> Calling (frame-parameter nil 'font-backend) returns (ftcrhb x).
> --
> Manuel Giraud
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 01 Oct 2025 17:04:02 GMT) Full text and rfc822 format available.

Message #35 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb
 font backends
Date: Wed, 01 Oct 2025 19:02:54 +0200
Mike <mikeandmore <at> gmail.com> writes:

> Hi
>
> Thanks for the help!
>
> Hmm, I think you do not have font settings for the global pattern. Can you
> try the following in your fonts.conf?
>
>   <match target="pattern">
>     <edit name="antialias" mode="assign"><bool>true</bool></edit>
>     <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
>     <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
>     <edit name="hinting" mode="assign"><bool>false</bool></edit>
>     <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
>     <edit name="rgba" mode="assign"><const>rgb</const></edit>
>     <edit name="autohint" mode="assign"><bool>false</bool></edit>
>     <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
>   </match>
>
> This will affect how fonts are rendered system wide.

Hi,

I have prepend this to my ~/.config/fontconfig/fonts.conf that now looks
like this:

--8<---------------cut here---------------start------------->8---
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

  <match target="pattern">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
    <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>false</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
  </match>

  <alias>
    <family>monospace</family>
    <prefer><family>Ttyp0</family></prefer>
  </alias>
  <alias>
    <family>monospace serif</family>
    <prefer><family>Ttyp0</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>DejaVu Sans</family></prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer><family>DejaVu Serif</family></prefer>
  </alias>
  <alias>
    <family>emoji</family>
    <prefer><family>OpenMoji Black</family></prefer>
  </alias>
</fontconfig>
--8<---------------cut here---------------end--------------->8---

But with or without your patch, I could *not* see any differences in
Emacs when calling:

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting t :size 10))

or:

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting nil :size 10))

Also, with your patch, Emacs writes what seems like informations about
the font being loaded into the terminal from where it has been launched.
It is also very easy to crash Emacs by calling for example:

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting t :size 20))
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 01 Oct 2025 18:07:02 GMT) Full text and rfc822 format available.

Message #38 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Wed, 1 Oct 2025 14:06:06 -0400
[Message part 1 (text/plain, inline)]
Hi

Thanks a bunch!

On Wed, Oct 1, 2025 at 1:02 PM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:

> Mike <mikeandmore <at> gmail.com> writes:
>
> > Hi
> >
> > Thanks for the help!
> >
> > Hmm, I think you do not have font settings for the global pattern. Can
> you
> > try the following in your fonts.conf?
> >
> >   <match target="pattern">
> >     <edit name="antialias" mode="assign"><bool>true</bool></edit>
> >     <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
> >     <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
> >     <edit name="hinting" mode="assign"><bool>false</bool></edit>
> >     <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
> >     <edit name="rgba" mode="assign"><const>rgb</const></edit>
> >     <edit name="autohint" mode="assign"><bool>false</bool></edit>
> >     <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
> >   </match>
> >
> > This will affect how fonts are rendered system wide.
>
> Hi,
>
> I have prepend this to my ~/.config/fontconfig/fonts.conf that now looks
> like this:
>
> --8<---------------cut here---------------start------------->8---
> <?xml version="1.0"?>
> <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
> <fontconfig>
>
>   <match target="pattern">
>     <edit name="antialias" mode="assign"><bool>true</bool></edit>
>     <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
>     <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
>     <edit name="hinting" mode="assign"><bool>false</bool></edit>
>     <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
>     <edit name="rgba" mode="assign"><const>rgb</const></edit>
>     <edit name="autohint" mode="assign"><bool>false</bool></edit>
>     <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
>   </match>
>
>   <alias>
>     <family>monospace</family>
>     <prefer><family>Ttyp0</family></prefer>
>   </alias>
>   <alias>
>     <family>monospace serif</family>
>     <prefer><family>Ttyp0</family></prefer>
>   </alias>
>   <alias>
>     <family>sans-serif</family>
>     <prefer><family>DejaVu Sans</family></prefer>
>   </alias>
>   <alias>
>     <family>serif</family>
>     <prefer><family>DejaVu Serif</family></prefer>
>   </alias>
>   <alias>
>     <family>emoji</family>
>     <prefer><family>OpenMoji Black</family></prefer>
>   </alias>
> </fontconfig>
> --8<---------------cut here---------------end--------------->8---
>
> But with or without your patch, I could *not* see any differences in
> Emacs when calling:
>

This is exactly the problem I'm trying to resolve here, and it looks much
harder than I expect!

Is your installation a debian? I wonder if I can reproduce that from a VM.


>
> (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
> t :size 10))
>
> or:
>
> (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
> nil :size 10))
>
> Also, with your patch, Emacs writes what seems like informations about
> the font being loaded into the terminal from where it has been launched.
> It is also very easy to crash Emacs by calling for example:
>
> (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
> t :size 20))
>

I've never encountered that, do you have a stack trace?



> --
> Manuel Giraud
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 01 Oct 2025 19:23:02 GMT) Full text and rfc822 format available.

Message #41 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb
 font backends
Date: Wed, 01 Oct 2025 21:22:20 +0200
Mike <mikeandmore <at> gmail.com> writes:

[...]

>> But with or without your patch, I could *not* see any differences in
>> Emacs when calling:
>>
>
> This is exactly the problem I'm trying to resolve here, and it looks much
> harder than I expect!

So you're saying user's fonts.conf (here with no hinting) should take
precedence over what an Emacs' user sets in a set-face-attribute call?
Why is that a problem that this currently is the other way around?

> Is your installation a debian? I wonder if I can reproduce that from a
> VM.

No, I'm using OpenBSD.  What do you want to reproduce in a VM?

[...]

>> (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
>> t :size 20))
>>
>
> I've never encountered that, do you have a stack trace?

No but I could try to make one from gdb.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 01 Oct 2025 19:46:02 GMT) Full text and rfc822 format available.

Message #44 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Wed, 1 Oct 2025 15:45:33 -0400
[Message part 1 (text/plain, inline)]
On Wed, Oct 1, 2025 at 3:22 PM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:

> Mike <mikeandmore <at> gmail.com> writes:
>
> [...]
>
> >> But with or without your patch, I could *not* see any differences in
> >> Emacs when calling:
> >>
> >
> > This is exactly the problem I'm trying to resolve here, and it looks much
> > harder than I expect!
>
> So you're saying user's fonts.conf (here with no hinting) should take
> precedence over what an Emacs' user sets in a set-face-attribute call?
> Why is that a problem that this currently is the other way around?
>
> > Is your installation a debian? I wonder if I can reproduce that from a
> > VM.
>
> No, I'm using OpenBSD.  What do you want to reproduce in a VM?
>

Yes, let me set up a VM first.


>
> [...]
>
> >> (set-face-attribute 'default nil :font (font-spec :family "Hack"
> :hinting
> >> t :size 20))
> >>
> >
> > I've never encountered that, do you have a stack trace?
>
> No but I could try to make one from gdb.
>

Thanks, I'd really appreciate that!


> --
> Manuel Giraud
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Wed, 01 Oct 2025 20:18:01 GMT) Full text and rfc822 format available.

Message #47 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Wed, 1 Oct 2025 16:17:32 -0400
[Message part 1 (text/plain, inline)]
On Wed, Oct 1, 2025 at 3:22 PM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:

> Mike <mikeandmore <at> gmail.com> writes:
>
> [...]
>
> >> But with or without your patch, I could *not* see any differences in
> >> Emacs when calling:
> >>
> >
> > This is exactly the problem I'm trying to resolve here, and it looks much
> > harder than I expect!
>
> So you're saying user's fonts.conf (here with no hinting) should take
> precedence over what an Emacs' user sets in a set-face-attribute call?
> Why is that a problem that this currently is the other way around?
>

No, the other way around. Emacs's set-face-attribute should override
system-wide font setting.


>
> > Is your installation a debian? I wonder if I can reproduce that from a
> > VM.
>
> No, I'm using OpenBSD.  What do you want to reproduce in a VM?
>
> [...]
>
> >> (set-face-attribute 'default nil :font (font-spec :family "Hack"
> :hinting
> >> t :size 20))
> >>
> >
> > I've never encountered that, do you have a stack trace?
>
> No but I could try to make one from gdb.
> --
> Manuel Giraud
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Thu, 02 Oct 2025 05:56:01 GMT) Full text and rfc822 format available.

Message #50 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org, mikeandmore <at> gmail.com
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Thu, 02 Oct 2025 08:54:42 +0300
> Cc: 79090 <at> debbugs.gnu.org
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Date: Wed, 01 Oct 2025 21:22:20 +0200
> 
> Mike <mikeandmore <at> gmail.com> writes:
> 
> [...]
> 
> >> But with or without your patch, I could *not* see any differences in
> >> Emacs when calling:
> >>
> >
> > This is exactly the problem I'm trying to resolve here, and it looks much
> > harder than I expect!
> 
> So you're saying user's fonts.conf (here with no hinting) should take
> precedence over what an Emacs' user sets in a set-face-attribute call?
> Why is that a problem that this currently is the other way around?

Not only should it not be a problem, I think it _must_ be so.  User
settings in Emacs should be able to override the defaults set by
fonts.conf.  Otherwise, we'd need to tell our users that configuring
Emacs fonts needs to be done in system-wide fonts.conf, which sounds
wrong.  It also affects other applications on the system, which again
sounds wrong to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Thu, 02 Oct 2025 06:32:02 GMT) Full text and rfc822 format available.

Message #53 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb
 font backends
Date: Thu, 02 Oct 2025 08:31:35 +0200
Mike <mikeandmore <at> gmail.com> writes:

> On Wed, Oct 1, 2025 at 3:22 PM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:
>
>> Mike <mikeandmore <at> gmail.com> writes:
>>
>> [...]
>>
>> >> But with or without your patch, I could *not* see any differences in
>> >> Emacs when calling:
>> >>
>> >
>> > This is exactly the problem I'm trying to resolve here, and it looks much
>> > harder than I expect!
>>
>> So you're saying user's fonts.conf (here with no hinting) should take
>> precedence over what an Emacs' user sets in a set-face-attribute call?
>> Why is that a problem that this currently is the other way around?
>>
>
> No, the other way around. Emacs's set-face-attribute should override
> system-wide font setting.

Sorry, I was mistaken.  What you want is that Emacs should be able to
override (hinting for example) even if the user has settings into
fonts.conf that say otherwise.

So for the moment, your patch does not do this for me.  Also I'll try to
make a stack trace in case of a crash.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Thu, 02 Oct 2025 13:58:02 GMT) Full text and rfc822 format available.

Message #56 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb
 font backends
Date: Thu, 02 Oct 2025 15:57:26 +0200
Manuel Giraud <manuel <at> ledu-giraud.fr> writes:

> Mike <mikeandmore <at> gmail.com> writes:
>
>> On Wed, Oct 1, 2025 at 3:22 PM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:
>>
>>> Mike <mikeandmore <at> gmail.com> writes:
>>>
>>> [...]
>>>
>>> >> But with or without your patch, I could *not* see any differences in
>>> >> Emacs when calling:
>>> >>
>>> >
>>> > This is exactly the problem I'm trying to resolve here, and it looks much
>>> > harder than I expect!
>>>
>>> So you're saying user's fonts.conf (here with no hinting) should take
>>> precedence over what an Emacs' user sets in a set-face-attribute call?
>>> Why is that a problem that this currently is the other way around?
>>>
>>
>> No, the other way around. Emacs's set-face-attribute should override
>> system-wide font setting.
>
> Sorry, I was mistaken.  What you want is that Emacs should be able to
> override (hinting for example) even if the user has settings into
> fonts.conf that say otherwise.
>
> So for the moment, your patch does not do this for me.  Also I'll try to
> make a stack trace in case of a crash.

Here is the crash I get with your patch when evaluating:

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting nil :size 20))

--8<---------------cut here---------------start------------->8---
Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000058f1a925c0b in image_pix_context_get_pixel (image=0x5912bb71220, x=28, y=28)
    at image.c:267
267	    return ((uint32_t *)(image->data + y * image->bytes_per_line))[x];
(gdb) bt
#0  0x0000058f1a925c0b in image_pix_context_get_pixel (image=0x5912bb71220, x=28, y=28)
    at image.c:267
#1  0x0000058f1a928870 in four_corners_best (pimg=0x5912bb71220, corners=0x59160679890, 
    width=29, height=29) at image.c:1955
#2  0x0000058f1a9289da in image_background (img=0x59160679800, f=0x59175e8a468, 
    pimg=0x5912bb71220) at image.c:2000
#3  0x0000058f1a928596 in prepare_image_for_display (f=0x59175e8a468, img=0x59160679800)
    at image.c:1862
#4  0x0000058f1a60d02f in produce_image_glyph (it=0x78127abe6110) at xdisp.c:32042
#5  0x0000058f1a61364b in gui_produce_glyphs (it=0x78127abe6110) at xdisp.c:33844
#6  0x0000058f1a5ce53b in display_tool_bar_line (it=0x78127abe6110, height=-1)
    at xdisp.c:15775
#7  0x0000058f1a5cec63 in tool_bar_height (f=0x59175e8a468, n_rows=0x59175e8a5d8, 
    pixelwise=true) at xdisp.c:15901
#8  0x0000058f1a5cefa4 in redisplay_tool_bar (f=0x59175e8a468) at xdisp.c:15999
#9  0x0000058f1a5e29ba in redisplay_window (window=..., just_this_one_p=false)
    at xdisp.c:21335
#10 0x0000058f1a5d56da in redisplay_window_0 (window=...) at xdisp.c:18321
#11 0x0000058f1a82ca9a in internal_condition_case_1 (
    bfun=0x58f1a5d5694 <redisplay_window_0>, arg=..., handlers=..., 
    hfun=0x58f1a5d555f <redisplay_window_error>) at eval.c:1714
#12 0x0000058f1a5d5531 in redisplay_windows (window=...) at xdisp.c:18290
#13 0x0000058f1a5d3daa in redisplay_internal () at xdisp.c:17707
#14 0x0000058f1a5c56db in resize_echo_area_exactly () at xdisp.c:13069
#15 0x0000058f1a742d1e in command_loop_1 () at keyboard.c:1573
#16 0x0000058f1a82c9a5 in internal_condition_case (bfun=0x58f1a7421ea <command_loop_1>, 
    handlers=..., hfun=0x58f1a7414fa <cmd_error>) at eval.c:1690
#17 0x0000058f1a741d53 in command_loop_2 (handlers=...) at keyboard.c:1163
#18 0x0000058f1a82bd97 in internal_catch (tag=..., func=0x58f1a741d28 <command_loop_2>, 
    arg=...) at eval.c:1370
#19 0x0000058f1a741cda in command_loop () at keyboard.c:1141
#20 0x0000058f1a740f40 in recursive_edit_1 () at keyboard.c:749
#21 0x0000058f1a74118b in Frecursive_edit () at keyboard.c:832
#22 0x0000058f1a73c547 in main (argc=2, argv=0x78127abecb58) at emacs.c:2629
--8<---------------cut here---------------end--------------->8---

-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Mon, 06 Oct 2025 01:28:06 GMT) Full text and rfc822 format available.

Message #59 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Sun, 5 Oct 2025 21:27:16 -0400
[Message part 1 (text/plain, inline)]
I believe that crash is OpenBSD specific. I can reproduce the crash without
my patch on Emacs 30.2 too.

Let me know if you can reproduce the following:

1. Without any fontconfig configuration. Both vanilla Emacs and my patch
can apply the hinting font-spec.

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
nil :size 10))
(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting t
:size 10))

2. With basic fontconfig configuration:

  <match target="pattern">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="globaladvance" mode="assign"><bool>true</bool></edit>
    <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>false</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
  </match>

You'll need to set :hintstyle too too see the difference. Both vanilla
Emacs and my patch can apply the hinting font-spec.

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
nil :hintstyle 'hintnone :size 10))
(set-face-attribute 'default nil :font (font-spec :family "Hack"
:hinting t :hintstyle 'hintfull :size 10))

3. With font family specific fontconfig configuration + basic fontconfig
configuration:

  <match target="font">
    <test name="family"><string>Hack</string></test>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
  </match>

(set-face-attribute 'default nil :font (font-spec :family "Hack" :size 10))

My patch applies hinting and hintstyle but vanilla Emacs does not.

(set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
nil :hintstyle 'hintnone :size 10))
(set-face-attribute 'default nil :font (font-spec :family "Hack"
:hinting t :hintstyle 'hintfull :size 10))

My patch also applies font-spec settings with no problem but vanilla Emacs
does not.

In summary, it seems my patch only makes a difference when you have font
family specific configurations in fontconfig.

On Thu, Oct 2, 2025 at 9:57 AM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:

> Manuel Giraud <manuel <at> ledu-giraud.fr> writes:
>
> > Mike <mikeandmore <at> gmail.com> writes:
> >
> >> On Wed, Oct 1, 2025 at 3:22 PM Manuel Giraud <manuel <at> ledu-giraud.fr>
> wrote:
> >>
> >>> Mike <mikeandmore <at> gmail.com> writes:
> >>>
> >>> [...]
> >>>
> >>> >> But with or without your patch, I could *not* see any differences in
> >>> >> Emacs when calling:
> >>> >>
> >>> >
> >>> > This is exactly the problem I'm trying to resolve here, and it looks
> much
> >>> > harder than I expect!
> >>>
> >>> So you're saying user's fonts.conf (here with no hinting) should take
> >>> precedence over what an Emacs' user sets in a set-face-attribute call?
> >>> Why is that a problem that this currently is the other way around?
> >>>
> >>
> >> No, the other way around. Emacs's set-face-attribute should override
> >> system-wide font setting.
> >
> > Sorry, I was mistaken.  What you want is that Emacs should be able to
> > override (hinting for example) even if the user has settings into
> > fonts.conf that say otherwise.
> >
> > So for the moment, your patch does not do this for me.  Also I'll try to
> > make a stack trace in case of a crash.
>
> Here is the crash I get with your patch when evaluating:
>
> (set-face-attribute 'default nil :font (font-spec :family "Hack" :hinting
> nil :size 20))
>
> --8<---------------cut here---------------start------------->8---
> Thread 1 received signal SIGSEGV, Segmentation fault.
> 0x0000058f1a925c0b in image_pix_context_get_pixel (image=0x5912bb71220,
> x=28, y=28)
>     at image.c:267
> 267         return ((uint32_t *)(image->data + y *
> image->bytes_per_line))[x];
> (gdb) bt
> #0  0x0000058f1a925c0b in image_pix_context_get_pixel
> (image=0x5912bb71220, x=28, y=28)
>     at image.c:267
> #1  0x0000058f1a928870 in four_corners_best (pimg=0x5912bb71220,
> corners=0x59160679890,
>     width=29, height=29) at image.c:1955
> #2  0x0000058f1a9289da in image_background (img=0x59160679800,
> f=0x59175e8a468,
>     pimg=0x5912bb71220) at image.c:2000
> #3  0x0000058f1a928596 in prepare_image_for_display (f=0x59175e8a468,
> img=0x59160679800)
>     at image.c:1862
> #4  0x0000058f1a60d02f in produce_image_glyph (it=0x78127abe6110) at
> xdisp.c:32042
> #5  0x0000058f1a61364b in gui_produce_glyphs (it=0x78127abe6110) at
> xdisp.c:33844
> #6  0x0000058f1a5ce53b in display_tool_bar_line (it=0x78127abe6110,
> height=-1)
>     at xdisp.c:15775
> #7  0x0000058f1a5cec63 in tool_bar_height (f=0x59175e8a468,
> n_rows=0x59175e8a5d8,
>     pixelwise=true) at xdisp.c:15901
> #8  0x0000058f1a5cefa4 in redisplay_tool_bar (f=0x59175e8a468) at
> xdisp.c:15999
> #9  0x0000058f1a5e29ba in redisplay_window (window=...,
> just_this_one_p=false)
>     at xdisp.c:21335
> #10 0x0000058f1a5d56da in redisplay_window_0 (window=...) at xdisp.c:18321
> #11 0x0000058f1a82ca9a in internal_condition_case_1 (
>     bfun=0x58f1a5d5694 <redisplay_window_0>, arg=..., handlers=...,
>     hfun=0x58f1a5d555f <redisplay_window_error>) at eval.c:1714
> #12 0x0000058f1a5d5531 in redisplay_windows (window=...) at xdisp.c:18290
> #13 0x0000058f1a5d3daa in redisplay_internal () at xdisp.c:17707
> #14 0x0000058f1a5c56db in resize_echo_area_exactly () at xdisp.c:13069
> #15 0x0000058f1a742d1e in command_loop_1 () at keyboard.c:1573
> #16 0x0000058f1a82c9a5 in internal_condition_case (bfun=0x58f1a7421ea
> <command_loop_1>,
>     handlers=..., hfun=0x58f1a7414fa <cmd_error>) at eval.c:1690
> #17 0x0000058f1a741d53 in command_loop_2 (handlers=...) at keyboard.c:1163
> #18 0x0000058f1a82bd97 in internal_catch (tag=..., func=0x58f1a741d28
> <command_loop_2>,
>     arg=...) at eval.c:1370
> #19 0x0000058f1a741cda in command_loop () at keyboard.c:1141
> #20 0x0000058f1a740f40 in recursive_edit_1 () at keyboard.c:749
> #21 0x0000058f1a74118b in Frecursive_edit () at keyboard.c:832
> #22 0x0000058f1a73c547 in main (argc=2, argv=0x78127abecb58) at
> emacs.c:2629
> --8<---------------cut here---------------end--------------->8---
>
> --
> Manuel Giraud
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Mon, 06 Oct 2025 15:23:02 GMT) Full text and rfc822 format available.

Message #62 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Mike <mikeandmore <at> gmail.com>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb
 font backends
Date: Mon, 06 Oct 2025 17:21:55 +0200
Mike <mikeandmore <at> gmail.com> writes:

Hi Mike,

> I believe that crash is OpenBSD specific. I can reproduce the crash
> without my patch on Emacs 30.2 too.

Yes, you're right.  I was also able to reproduce it with current master.
So this is another story.

> Let me know if you can reproduce the following:

I have made all the tests you proposed and resumed them in the following
table:

|                  | Vanilla         | Patched                    |
|                  | (master)        |                            |
|------------------+-----------------+----------------------------|
| No fontconfig    | Correct change  | Correct change             |
|                  | between hinting | between hinting            |
|                  | and no hinting. | and no hinting.            |
|------------------+-----------------+----------------------------|
| Basic fontconfig | No hinting even | Same as above.             |
|                  | when force from |                            |
|                  | Emacs.          |                            |
|------------------+-----------------+----------------------------|
| Basic + family   | No hinting even | Correct hinting with       |
| fontconfig       | when force from | only font selection.       |
|                  | Emacs.          | Correct hinting/no hinting |
|                  |                 | change.                    |
|------------------+-----------------+----------------------------|

So maybe, there is no problem left with your patch.  WDYT?
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Mon, 06 Oct 2025 16:31:02 GMT) Full text and rfc822 format available.

Message #65 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Mike <mikeandmore <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 79090 <at> debbugs.gnu.org
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Mon, 6 Oct 2025 12:29:40 -0400
[Message part 1 (text/plain, inline)]
It looks mostly correct. The patch only makes a difference when you have
global rendering settings + family specific settings in fontconfig.

Without family specific fontconfig, you can enable hinting if you set
:hintstyle 'hintfull. I think that is the expected behaviour, because
custom settings are overriding the system default. It's just that there are
two custom settings to enable hinting. Under this condition, the patch does
not make a difference anyway.

Eli, if this is all good, I can remove the print statement (it was for
debugging) so that you can merge.

On Mon, Oct 6, 2025 at 11:21 AM Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:

> Mike <mikeandmore <at> gmail.com> writes:
>
> Hi Mike,
>
> > I believe that crash is OpenBSD specific. I can reproduce the crash
> > without my patch on Emacs 30.2 too.
>
> Yes, you're right.  I was also able to reproduce it with current master.
> So this is another story.
>
> > Let me know if you can reproduce the following:
>
> I have made all the tests you proposed and resumed them in the following
> table:
>
> |                  | Vanilla         | Patched                    |
> |                  | (master)        |                            |
> |------------------+-----------------+----------------------------|
> | No fontconfig    | Correct change  | Correct change             |
> |                  | between hinting | between hinting            |
> |                  | and no hinting. | and no hinting.            |
> |------------------+-----------------+----------------------------|
> | Basic fontconfig | No hinting even | Same as above.             |
> |                  | when force from |                            |
> |                  | Emacs.          |                            |
> |------------------+-----------------+----------------------------|
> | Basic + family   | No hinting even | Correct hinting with       |
> | fontconfig       | when force from | only font selection.       |
> |                  | Emacs.          | Correct hinting/no hinting |
> |                  |                 | change.                    |
> |------------------+-----------------+----------------------------|
>
> So maybe, there is no problem left with your patch.  WDYT?
> --
> Manuel Giraud
>


-- 
Thanks
Mike
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Mon, 06 Oct 2025 17:08:01 GMT) Full text and rfc822 format available.

Message #68 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mike <mikeandmore <at> gmail.com>, Po Lu <luangruo <at> yahoo.com>
Cc: 79090 <at> debbugs.gnu.org, manuel <at> ledu-giraud.fr
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Mon, 06 Oct 2025 20:06:44 +0300
> Cc: 79090 <at> debbugs.gnu.org
> From: Mike <mikeandmore <at> gmail.com>
> Date: Mon, 6 Oct 2025 12:29:40 -0400
> 
> It looks mostly correct. The patch only makes a difference when you have global rendering settings + family
> specific settings in fontconfig.
> 
> Without family specific fontconfig, you can enable hinting if you set :hintstyle 'hintfull. I think that is the
> expected behaviour, because custom settings are overriding the system default. It's just that there are two
> custom settings to enable hinting. Under this condition, the patch does not make a difference anyway.
> 
> Eli, if this is all good, I can remove the print statement (it was for debugging) so that you can merge.

I'd like to hear the opinion of Po Lu.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79090; Package emacs. (Sat, 25 Oct 2025 10:15:02 GMT) Full text and rfc822 format available.

Message #71 received at 79090 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 79090 <at> debbugs.gnu.org, mikeandmore <at> gmail.com, manuel <at> ledu-giraud.fr
Subject: Re: bug#79090: Respects Fontconfig settings for ftcr and ftcrhb font
 backends
Date: Sat, 25 Oct 2025 13:14:24 +0300
Ping!  Po Lu, could you please chime in with your opinions on this?

> Cc: 79090 <at> debbugs.gnu.org, manuel <at> ledu-giraud.fr
> Date: Mon, 06 Oct 2025 20:06:44 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Cc: 79090 <at> debbugs.gnu.org
> > From: Mike <mikeandmore <at> gmail.com>
> > Date: Mon, 6 Oct 2025 12:29:40 -0400
> > 
> > It looks mostly correct. The patch only makes a difference when you have global rendering settings + family
> > specific settings in fontconfig.
> > 
> > Without family specific fontconfig, you can enable hinting if you set :hintstyle 'hintfull. I think that is the
> > expected behaviour, because custom settings are overriding the system default. It's just that there are two
> > custom settings to enable hinting. Under this condition, the patch does not make a difference anyway.
> > 
> > Eli, if this is all good, I can remove the print statement (it was for debugging) so that you can merge.
> 
> I'd like to hear the opinion of Po Lu.
> 
> 
> 
> 




This bug report was last modified 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.