[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig.
From: |
Taiju HIGASHI |
Subject: |
[bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig. |
Date: |
Thu, 22 Sep 2022 18:50:38 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) |
Hi Andrew and Ludovic,
Thanks for your input and background on the code style.
I'm not very knowledgeable about G-Expressions, so I don't understand
much of what you replied. (I will study it!).
Ludovic Courtès <ludo@gnu.org> writes:
> Hi Andrew,
>
> Andrew Tropin <andrew@trop.in> skribis:
>
>> 2. We had a discussion with Ludovic about rde home services vs guix home
>> services styles. And this one looks like rde style, not guix.
>>
>> rde takes arbitrary s-exps and g-exps with optional structure checks and
>> serializes them to target format.
>>
>> guix uses nested records with rigid nesting structure.
>
> That’s generally true, but it’s not black and white and there’s room for
> discussion. :-)
>
> In this case, Taiju’s proposal is to let users write snippets like this:
>
> (define font-family-map
> '((sans-serif . "Noto Sans CJK JP")
> (serif . "Noto Serif CJK JP")))
>
> (home-environment
> (packages (list font-google-noto))
> (services
> (list
> (simple-service 'my-fontconfig-service
> home-fontconfig-service-type
> (list
> (call-with-output-string
> (lambda (port)
> (sxml->xml
> (map (lambda (pair)
> `(alias
> (family ,(car pair))
> (prefer
> (family ,(cdr pair)))))
> font-family-map)
> port))))))))
>
> (With v2 they’d provide SXML instead of XML-in-a-string, so it’s
> slightly less verbose but quite similar.)
>
> In this particular case, I would find it easier to use if one could
> provide a set of <font-alias> records, let’s say along these lines:
>
> (simple-service 'my-fontconfig-service
> home-fontconfig-service-type
> (list (font-alias 'sans-serif "Noto Sans CJK JP") …))
>
> That way, users wouldn’t need to know the details of the XML syntax for
> fontconfig.
>
> The downside is that it restricts what can be done: it lets you add font
> aliases, but nothing more.
>
> Do you have other use cases in mind, Taiju?
My motivation for writing this patch is that I wanted to continue to use
the settings in the following file after switching to Guix Home.
https://git.sr.ht/~taiju/taix/tree/31a37c231ebba60e38f7fa9cfe1c7a5d7362d021/item/dotfiles/fontconfig/.config/fontconfig/fonts.conf
Honestly, I don't know why it is so complicated, but I refered it from
the following ArchWiki content.
https://wiki.archlinux.org/title/Font_configuration/Examples#Japanese
Therefore, just being able to set font aliasing is unfortunately not
enough to satisfy my use case.
Thanks,
--
Taiju
[bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig., Taiju HIGASHI, 2022/09/21
- [bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig., Andrew Tropin, 2022/09/22
- [bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig., Ludovic Courtès, 2022/09/22
- [bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig.,
Taiju HIGASHI <=
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Ludovic Courtès, 2022/09/24
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Taiju HIGASHI, 2022/09/24
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Liliana Marie Prikler, 2022/09/25
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Taiju HIGASHI, 2022/09/25
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Taiju HIGASHI, 2022/09/25
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Liliana Marie Prikler, 2022/09/25
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Taiju HIGASHI, 2022/09/25
- [bug#57963] [PATCH 0/1] Support user's fontconfig., Liliana Marie Prikler, 2022/09/26
[bug#57963] [PATCH v3] home: fontutils: Support user's fontconfig., Taiju HIGASHI, 2022/09/27