GNU bug report logs - #65741
The URW fontconfig dilemma

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Bruno Victal <mirai@HIDDEN>; dated Mon, 4 Sep 2023 17:42:01 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 4 Sep 2023 17:41:52 +0000
From debbugs-submit-bounces <at> Mon Sep 04 13:41:52 2023
Received: from localhost ([]:52513
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1qdDaB-0000pr-Pa
	for submit <at>; Mon, 04 Sep 2023 13:41:52 -0400
Received: from ([2001:470:142::17]:36350)
 by with esmtp (Exim 4.84_2)
 (envelope-from <mirai@HIDDEN>) id 1qdDa9-0000pd-Lf
 for submit <at>; Mon, 04 Sep 2023 13:41:50 -0400
Received: from ([2001:470:142:3::10])
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mirai@HIDDEN>) id 1qdDa3-0008WC-L8
 for bug-guix@HIDDEN; Mon, 04 Sep 2023 13:41:43 -0400
Received: from ([])
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mirai@HIDDEN>) id 1qdDa0-0001aK-So
 for bug-guix@HIDDEN; Mon, 04 Sep 2023 13:41:43 -0400
Received: from (unknown [])
 by (Postfix) with ESMTP id F37D220CAE
 for <bug-guix@HIDDEN>; Mon,  4 Sep 2023 19:41:25 +0200 (CEST)
Received: from localhost (localhost [])
 by (Postfix) with ESMTP id C4B408005B;
 Mon,  4 Sep 2023 19:33:55 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at
Received: from ([])
 by localhost ( []) (amavisd-new, port 10026)
 with ESMTP id C_QdVo413P-W; Mon,  4 Sep 2023 19:33:54 +0200 (CEST)
Received: from [] (unknown [])
 (Authenticated sender: lumen@HIDDEN)
 by (Postfix) with ESMTPSA id BF02F80060;
 Mon,  4 Sep 2023 19:33:54 +0200 (CEST)
Message-ID: <e9c47e35-1b50-4db3-b1ee-6659b22b2381@HIDDEN>
Date: Mon, 4 Sep 2023 18:33:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: bug-guix <bug-guix@HIDDEN>
From: Bruno Victal <mirai@HIDDEN>
Subject: The URW fontconfig dilemma
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=; envelope-from=mirai@HIDDEN;
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -0.0 (/)

During my attempt to build the enblend-enfuse documentation [1],
it would fail and display the following message:
--8<---------------cut here---------------start------------->8---
Error: fontconfig: Didn't find expected font family. Perhaps URW Type 1 fonts need installing?
--8<---------------cut here---------------end--------------->8---

Naturally searching for the URW fonts in guix didn't yield anything
other than some texlive packages so I ended up writing a definition
for it.
It turned out to be unnecessary as I later found out 'font-ghostscript'
provides just that. (an issue of discoverability perhaps?)

Nonetheless my newly written package (which should be “merged” into
the definition of 'font-ghostscript' with a better description and
perhaps a rename) is an update of what font-ghostscript provides and
should work just the same, in theory. (spoilers: it doesn't)

Intrigued by this difference and after some doc reading and several
arcane commands thrown in desperation, I've distilled them to this:

With the existing font-ghostscript package:
--8<---------------cut here---------------start------------->8---
$ guix shell -C font-ghostscript fontconfig
[env]$ fc-match 'Nimbus Sans L'
n019003l.pfb: "Nimbus Sans L" "Regular"
--8<---------------cut here---------------end--------------->8---

With the new font-urw-base35 package (definition below):
--8<---------------cut here---------------start------------->8---
$ ~/src/guix/pre-inst-env guix shell -C font-urw-base35 fontconfig
[env]$ fc-match 'Nimbus Sans L' 
DejaVuSans.ttf: "DejaVu Sans" "Book"
--8<---------------cut here---------------end--------------->8---

The source of the font-urw-base35 has a file for fontconfig at
'fontconfig/urw-fallback-backwards.conf' that contains this:
--8<---------------cut here---------------start------------->8---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

This file is used to alias/map previous versions of font families from (URW)++
to similar/metric-conmpatible font families of latest font versions from
(URW)++ itself.

Most likely this aliasing/mapping will be useful for people who:
 * have latest versions of (URW)++ fonts, but their documents still reference
   or requires older versions of these fonts

latest URW fonts:     previous URW fonts:
====================  =============================================
Nimbus Mono PS        Nimbus Mono L | Nimbus Mono
URW Gothic            URW Gothic L
URW Bookman           URW Bookman L | Bookman URW
Z003                  URW Chancery L | Chancery URW
D050000L              Dingbats
Nimbus Sans           Nimbus Sans L
Nimbus Sans Narrow    Nimbus Sans Narrow (same as current name)
C059                  Century Schoolbook L | Century SchoolBook URW
P052                  URW Palladio L | Palladio URW
Standard Symbols PS   Standard Symbols L
Nimbus Roman          Nimbus Roman No9 L
  <alias binding="same">
    <family>Nimbus Sans L</family>
      <family>Nimbus Sans</family>
--8<---------------cut here---------------end--------------->8---

So unless I misunderstood the fontconfig documentation and the comment,
'fc-match' should have found the newer Nimbus Sans, not DejaVu Sans.
What gives?

The definition for this font-urw-base35 package:
--8<---------------cut here---------------start------------->8---
;; Note: add #:use-module (guix build-system copy) to gnu/packages/fonts.scm.
;; when trying this out.
;; See <> for more information.
(define-public font-urw-base35
  (let ((commit "3c0ba3b5687632dfc66526544a4e811fe0ec0cd9")
        (revision "0")
        (base-version "20200910"))
      (name "font-urw-base35")
      (version (git-version base-version revision commit))
         (method git-fetch)
         (uri (git-reference
               (url "")
               (commit commit)))
         (file-name (git-file-name name version))
      (build-system copy-build-system)
        #~`(("fonts/" "share/fonts/urw-base35"
             #:exclude ("README" "COPYING"))
            ("appstream/" "share/metainfo"
             #:exclude (""))
            ("fontconfig/" "share/fontconfig/conf.avail/"
             #:exclude ("")))
        #~(modify-phases %standard-phases
            (add-before 'install 'configure
              (lambda _
                ;; Set font priority for fontconfig.
                (with-directory-excursion "fontconfig"
                  (for-each (lambda (f)
                              ;; As recommended in the
                              (rename-file f
                                           (string-append "61-"
                                                          (basename f))))
                            (find-files "." "\\.conf$"
                                        #:fail-on-error? #t))))))))
      (home-page "")
      (synopsis "URW++ base 35 font set.")
      (description "This package provides substitutes for the 35 fonts
required by Adobe Postscript(c) Language Level 2 specification.")
      (license license:agpl3))))
--8<---------------cut here---------------end--------------->8---

[1]: <>

Furthermore, I consider that nonfree software must be eradicated.


Acknowledgement sent to Bruno Victal <mirai@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#65741; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 4 Sep 2023 17:45:02 UTC

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