GNU bug report logs - #57963
[PATCH 0/1] Support user's fontconfig.

Previous Next

Package: guix-patches;

Reported by: Taiju HIGASHI <higashi <at> taiju.info>

Date: Wed, 21 Sep 2022 00:28:02 UTC

Severity: normal

Tags: patch

Full log


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

From: Taiju HIGASHI <higashi <at> taiju.info>
To: Declan Tsien <declantsien <at> riseup.net>
Cc: 57963 <at> debbugs.gnu.org, liliana.prikler <at> gmail.com,
 Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#57963: [PATCH 0/1] Support user's fontconfig.
Date: Thu, 20 Oct 2022 12:44:33 +0900
Declan Tsien <declantsien <at> riseup.net> writes:

> Taiju HIGASHI <higashi <at> taiju.info> writes:
>
>>
>> By the way, should we be able to specify the binding attribute as well?
>>
>
> I checked the fontconfig doc.
> https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
> Here is the relevant portation:
>
>> There is one special case to this rule; family names are split into
>> two bindings; strong and weak. Strong family names are given greater
>> precedence in the match than lang elements while weak family names are
>> given lower precedence than lang elements. This permits the document
>> language to drive font selection when any document specified font is
>> unavailable.
>
> I guess it's ok to ignore or set a default =strong= when serializing?
>

If you put the setting below,

--8<---------------cut here---------------start------------->8---
(home-fontconfig-configuration
  (default-font-serif-family "Noto Serif CJK JP")
  (default-font-sans-serif-family "Noto Sans Serif CJK JP")
  (default-font-monospace-family "PlemolJP Console"))
--8<---------------cut here---------------end--------------->8---

The current implementation serializes below.

--8<---------------cut here---------------start------------->8---
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <dir>~/.guix-home/profile/share/fonts</dir>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Noto Serif CJK JP</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Noto Sans Serif CJK JP</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>PlemolJP Console</family>
    </prefer>
  </alias>
</fontconfig>
--8<---------------cut here---------------end--------------->8---

Since the binding attribute is omitted, it would be interpreted as the
default weak.
ref: https://github.com/behdad/fontconfig/blob/5b41ded2b0ddb98a07ac86264b94403cb7a0fd82/fonts.dtd#L127-L128

I would like the default-font-* fields to cover only typical settings.
Instead, we provide extra-config field to be used for settings that are
not typical.

You can also configure the settings you want by specifying them in
extra-config.

--8<---------------cut here---------------start------------->8---
(home-fontconfig-configuration
 (extra-config
  '((alias (@ (binding "strong"))
	   (family "sans-serif")
	   (prefer
	    (family "WenQuanYi Micro Hei")
	    (family "Noto Sans")))
    (alias (@ (binding "strong"))
	   (family "monospace")
	   (prefer
	    (family "Sarasa Mono CL")
	    (family "Inconsolata")
	    (family "Noto Mono"))))))
--8<---------------cut here---------------end--------------->8---

I don't see clearly what the typical configuration of alias should be,
but I believe the current specification is sufficient for our needs.

Do you still think it is preferable to change the default-font-* field
interface, even knowing that you can configure it in the extra-config
field?  Please give me your frank opinion :)

Thanks,
-- 
Taiju




This bug report was last modified 215 days ago.

Previous Next


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