unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Leo Famulari <leo@famulari.name>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: fontconfig: Add replacement with font-dejavu instead of gs-fonts.
Date: Wed, 20 May 2020 13:28:13 +0200	[thread overview]
Message-ID: <87imgqc0c2.fsf@devup.no> (raw)
In-Reply-To: <20200519155020.GD24701@jasmine.lan>


[-- Attachment #1.1: Type: text/plain, Size: 1258 bytes --]

Leo Famulari <leo@famulari.name> writes:

> On Sun, May 17, 2020 at 04:50:12PM +0200, Marius Bakke wrote:
>> This is a hack to make (some) fonts working when users don't have fonts
>> specified in their system configuration, and (crucially) places where
>> the fontconfig cache may be unavailable such as 'guix pack's.
>> 
>> I'm not sure whether font-dejavu is a good replacement here.  Another
>> approach could be to convert gs-fonts to TrueType or OpenType format.
>> 
>> Thoughts?  I don't know much about fonts and would appreciate feedback.
>
> I think you should push right away, assuming that it helps and doesn't
> rebuild the world.

Someone on #guix wanted to test it, so I've attached the patch here
again to this message.

Will push later today unless anyone objects.  Though I'm still not
convinced 'font-dejavu' is a good replacement for 'gs-fonts'.

> The gs-fonts are important for printing so we might need a real fix
> later but for now a quick fix is the right thing.

The print infrastructure (CUPS, ghostscript) does not use Pango, so I
think gs-fonts still work there.

Might be difficult to work with when the end user applications don't
recognize them though.

What do you expect from a "real fix"?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-fontconfig-Add-replacement-with-font-dejavu-inst.patch --]
[-- Type: text/x-patch, Size: 2057 bytes --]

From ba3a99430ce1c0f6f27973e1d82539a67c769b89 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Sun, 17 May 2020 16:23:29 +0200
Subject: [PATCH] gnu: fontconfig: Add replacement with font-dejavu instead of
 gs-fonts.

This fixes <https://bugs.gnu.org/41282>, <https://bugs.gnu.org/41241>, and <https://bugs.gnu.org/41344>.
Reported by Pierre Neidhardt, W Knight, Alexandros Theodotou, and others.

* gnu/packages/fontutils.scm (fontconfig)[replacement]: New field.
(fontconfig/font-dejavu): New variable.
---
 gnu/packages/fontutils.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index e552ece50b..27c84d5814 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -37,6 +37,7 @@
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages fonts)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
@@ -292,6 +293,12 @@ fonts to/from the WOFF2 format.")
 (define-public fontconfig
   (package
    (name "fontconfig")
+
+   ;; This replacement is not security-related, but works around the fact
+   ;; that gs-fonts are not recognized by Pango, causing many applications
+   ;; to fail to find fonts otherwise.
+   (replacement fontconfig/font-dejavu)
+
    (version "2.13.1")
    (source (origin
             (method url-fetch)
@@ -348,6 +355,13 @@ high quality, anti-aliased and subpixel rendered text on a display.")
                        "See COPYING in the distribution."))
    (home-page "https://www.freedesktop.org/wiki/Software/fontconfig")))
 
+(define fontconfig/font-dejavu
+  (package
+    (inherit fontconfig)
+    (inputs
+     ;; XXX: Reuse the name to avoid having to override the configure flags.
+     `(("gs-fonts" ,font-dejavu)))))
+
 (define-public t1lib
   (package
    (name "t1lib")
-- 
2.26.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2020-05-20 11:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 14:50 [PATCH] gnu: fontconfig: Add replacement with font-dejavu instead of gs-fonts Marius Bakke
2020-05-19 15:50 ` Leo Famulari
2020-05-20 11:28   ` Marius Bakke [this message]
2020-05-20 22:59     ` Leo Famulari
2020-05-20 22:00   ` Marius Bakke
2020-05-20 12:06 ` zimoun
2020-05-20 13:55   ` Marius Bakke
2020-05-20 21:03     ` zimoun
2020-05-20 21:41       ` Marius Bakke
2020-05-20 23:35         ` zimoun
2020-05-21 12:46           ` Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imgqc0c2.fsf@devup.no \
    --to=mbakke@fastmail.com \
    --cc=guix-devel@gnu.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).