[Fontconfig] Difficulty finding a font file through the libraries

Michael Brennen michael at fishnet.us
Sat Oct 30 17:13:40 UTC 2021


> On Oct 29, 2021, at 03:34, Lawrence D'Oliveiro <ldo at geek-central.gen.nz> wrote:
> 
> On Fri, 29 Oct 2021 01:56:45 -0500, Michael Brennen wrote:
> 
>> ... it finds the font in the .ttf file, NOT the .ttf.orig file. The
>> difference is that in this configuration gs does not go through FC to
>> find the fonts.
> 
> OK, so the problem lies somewhere in the Fontconfig setup, but only
> when running that Ghostscript installation. Therefore there must be
> something different in how Fontconfig is configured when running
> Ghostscript. Environment variables in Apache?
> 
>> The difficulty is that there is a *lot* going on
>> in those files, and trying to gain some idea of what they do is not
>> trivial.
> 
> Yes. And we need to do this while reproducing the problem--that is,
> running Ghostscript and watching it fail to find the .ttf file and use
> .ttf.orig instead. Looking at the FC_DEBUG flags, it may be worthwhile
> turning on just about everything (FC_DEBUG=8191). You may end up with a
> huge logfile, but at least you can search through it to see where the
> .ttf.orig name is coming from.


Glancing briefly over the source, it appears that FcFontSetMatchInternal() should be printing significant debug information when FC_DEBUG=2 (=FC_DBG_MATCHV), but it is not.

I am running gs as follows:

================================
export FC_DEBUG=2
/usr/bin/gs -dNOPAUSE -sDEVICE=jpeg -dJPEGQ=100 -r288 -dDownScaleFactor=4 -sOutputFile=file-q-%02d.jpg "source.ai" -dBATCH >fc_gs_log 2>&1
================================


The contents of fc_gs_log are as follows. FC_DEBUG is set to 2, but there is no debug information. Does anyone have an idea why the extensive debug info is missing? I think I need to see that to understand why the .ttf file is being skipped. Thanks much….


================================
GPL Ghostscript 9.25 (2018-09-13)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 2.
Page 1
Querying operating system for font files...
DEBUG: FC_WEIGHT didn't match
FC_DEBUG=2
**** Warning: glyf overlaps cmap, truncating.
**** Warning: glyf overlaps cmap, truncating.
**** Warning: glyf overlaps cmap, truncating.
**** Warning: glyf overlaps cmap, truncating.
**** Warning: glyf overlaps cmap, truncating.
Can't find (or can't open) font file /usr/share/ghostscript/Resource/Font/MoongladeDEMO-Regular.
Can't find (or can't open) font file MoongladeDEMO-Regular.
Loading MoongladeDEMO-Regular font from /var/www/ext/resources/fonts/2- Moonglade Regular DEMO.ttf.orig... 4484276 3144792 12161916 2847020 3 done.
Page 2
Can't find (or can't open) font file /usr/share/ghostscript/Resource/Font/MoongladeDEMO-Regular.
Can't find (or can't open) font file MoongladeDEMO-Regular.
Loading MoongladeDEMO-Regular font from /var/www/ext/resources/fonts/2- Moonglade Regular DEMO.ttf.orig... 4765108 3344760 2344716 1014065 3 done.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20211030/eea91bb8/attachment.htm>


More information about the Fontconfig mailing list