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


View this message in rfc822 format

From: Taiju HIGASHI <higashi <at> taiju.info>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 57963 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>
Subject: [bug#57963] [PATCH v5 2/2] home: services: Support user's fontconfig configuration.
Date: Wed, 02 Nov 2022 10:43:21 +0900
Hi,

Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:

> Am Donnerstag, dem 27.10.2022 um 14:31 +0900 schrieb Taiju HIGASHI:
>> Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:
>>
>> > Am Donnerstag, dem 27.10.2022 um 13:00 +0900 schrieb Taiju HIGASHI:
>> > > Sorry for the long time it has taken to resolve the issue.
>> > > What do you think about it?
>> > Putting the discussion with Declan aside, the last thing mentioned
>> > was
>> > not trying to mix SXML and XML-in-strings.  Ludo offered the
>> > solutions:
>> > 1. Taking a <fontconfig-configuration> or a file-like object
>> > 2. (Optionally) using a gexp-compiler for the former
>> >
>> > Cheers
>>
>> Sorry for the lack of clarity.
>> I had sent you a past email confirming that the direction of the
>> implementation was correct and was waiting for your response.
>>
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57963#239
> Ahh, I missed that.  If you pull in the XML declarations and the
> <fontconfig></fontconfig> stuff to the serialization, you should
> basically have most of what you'd need for a G-Exp compiler, but even
> if not it'd simplify this to
>
> (match
>   ((? home-font-config-configuration? config)
>    (serialize-... config ...))
>   ((? file-like? config) config))
>
> Not sure if a match for type-checking would be needed since it's
> already taken care of elsewhere, so writing it just in case.
>
> Cheers

Sorry for my response delay.
Is my recognition correct?  I have plan to rewrite it as below.

--8<---------------cut here---------------start------------->8---
(define (serialize-fontconfig-configuration config)
  (define start-of-fontconfig "<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>")

  (define end-of-fontconfig "</fontconfig>\n")

  (mixed-text-file
   "fonts.conf"
   start-of-fontconfig
   (serialize-configuration config home-fontconfig-configuration-fields)
   end-of-fontconfig))

(define (add-fontconfig-config-file user-config)
  `(("fontconfig/fonts.conf"
     ,(match user-config
          ((? home-fontconfig-configuration? user-config)
           (serialize-fontconfig-configuration user-config))
        ((? file-like? user-config) user-config)))))
--8<---------------cut here---------------end--------------->8---

Thanks,
-- 
Taiju




This bug report was last modified 216 days ago.

Previous Next


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