guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#57963] [PATCH 0/1] Support user's fontconfig.


From: Taiju HIGASHI
Subject: [bug#57963] [PATCH 0/1] Support user's fontconfig.
Date: Thu, 20 Oct 2022 12:44:33 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Declan Tsien <declantsien@riseup.net> writes:

> Taiju HIGASHI <higashi@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]