On Oct 29, 2021, at 00:49, Lawrence D'Oliveiro <ldo@xxxxxxxxxxxxxxxxxxx> wrote:
I know better than to touch the /usr/share stuff for the long run; this is quick get to the point testing. :) Running the process as follows gives the same results. It finds the font in the .ttf.orig file. # sudo -u apache /usr/bin/gs …. The Fontmap file is /usr/share/ghostscript/Resource/Init/Fontmap; it has four lines in it that refer back to the Fontmap.GS file. I have not spent much time looking for an alternate gs configuration file under /etc, but so far I have not found one; besides, that is ancillary to the real problem. ====================================================== %! % See Fontmap.GS for the syntax of real Fontmap files. %% Replace 1 (Fontmap.GS) (Fontmap.GS) .runlibfile ====================================================== So if I comment the font directory path in /etc/fonts/local.conf and then run this script file as "sudo -u apache ./run_gs” (which I think should closely approximate php running the script as the apache user) #!/bin/bash export GS_FONTPATH=/var/www/ext/resources/fonts time /usr/bin/gs ... Processing pages 1 through 2. Page 1 Scanning /var/www/ext/resources/fonts for fonts...**** Warning: glyf overlaps cmap, truncating. **** Warning: glyf overlaps cmap, truncating. … 8859 files, 8358 scanned, 7393 new fonts. 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... 30637720 23902546 2708316 1039805 3 done. 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. Regarding the XML documentation, I have read that, but the XML syntax is not the difficulty sorting out the linked config files in /etc/fonts/conf.d. 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. Besides, I doubt that they have anything to do with gs not being able to find the font in the .ttf file when it searches through FC. Or do you think the preset config files have anything to do with this? I genuinely do not know. So as I see the question is still open why gs searching through FC does not find the font in the proper file, but when gs searches the fonts directly it successfully finds it. Does the name have anything to do with this? That is why I wondered about the configuration presets in /etc/fonts/conf.d, not knowing if they might have anything to do with the name format. Again, thanks for your patience. -- Michael |