[poppler] Question regarding font selection

William Bader williambader at hotmail.com
Thu Jul 6 11:39:58 UTC 2017


> Interesting, I did not know about this command.  Here's the output I get:
> Courier   7  0 Nimbus Mono L Bold  /usr/local/share/fonts/ghostscript/fonts/n022004l.pfb

If it shows /usr/local/share instead of /usr/share, it is coming from a package that you installed rather than a package that came with the distribution, and the problem could be customizations that you made to your system rather than problems with poppler.

On Fedora 25, /usr/share/fonts/default/Type1/n022023l.pfb is provided by urw-fonts

If it works for most people, the problem is probably something that you did to your system, and the easiest way to track it down might be getting the customized packages out of the path and then adding them back one by one until you find the one that causes the problem.

You can use an strace command like the one below to see everything that pdffonts touches

strace -e trace=open pdffonts file.pdf 2>&1 | less

Could you check that you have your distribution's fonts installed, then temporarily rename /usr/local to get it off the path, and then try pdffonts again?

Regards, William

________________________________
From: poppler <poppler-bounces at lists.freedesktop.org> on behalf of Pierre-Luc Samuel <Pierre-Luc.Samuel at ticketmaster.com>
Sent: Wednesday, July 5, 2017 3:47 PM
To: poppler at lists.freedesktop.org
Subject: Re: [poppler] Question regarding font selection



On 17-07-05 01:10 PM, Jason Crain wrote:
> On Wed, Jul 05, 2017 at 10:45:07AM -0400, Pierre-Luc Samuel wrote:
>> On 17-07-04 06:43 PM, Albert Astals Cid wrote:
>>> El dimarts, 4 de juliol de 2017, a les 17:06:07 CEST, Pierre-Luc Samuel va
>>> escriure:
>>>> I am experiencing weird font substitution with pdftocairo and was
>>>> wondering what was the algorithm to match fonts when converting from
>>>> PDF.  The Courier font (regular) is being substituted "Nimbus Mono L
>>>> Bold", even if fc-match return the non-bold version.
>>>>
>>>> $ fc-match "Courier"
>>>> n022003l.pfb: "Nimbus Mono L" "Regular"
>>>>
>>>> $ fc-match "Courier:style=bold"
>>>> n022004l.pfb: "Nimbus Mono L" "Bold"
>>>>
>>>> What could be the reason behind this?
>>> The pdf font can be asking for bold even if the name doesn't contain bold.
>>>
>> Thanks for your answer Albert.  I have attached a sample PDF and resulting
>> SVG with the problem I'm encountering.  I do not understand why the bold
>> font is selected for the first "Courier".
>>
>> pdftocairo version 0.56.0
> It works for me:
>
> $ pdffonts ~/courier.pdf  -subst
> name                                 object ID substitute font                      substitute font file
> ------------------------------------ --------- ------------------------------------ ------------------------------------
> Courier                                   7  0 Nimbus Mono L                        /usr/share/fonts/type1/gsfonts/n022003l.pfb
> Courier-Bold                              8  0 Nimbus Mono L Bold                   /usr/share/fonts/type1/gsfonts/n022004l.pfb
> Courier-Oblique                           9  0 Nimbus Mono L Regular Oblique        /usr/share/fonts/type1/gsfonts/n022023l.pfb
> Courier-BoldOblique                      10  0 Nimbus Mono L Bold Oblique           /usr/share/fonts/type1/gsfonts/n022024l.pfb
>
> With versions 0.48.0 and from git master.

Interesting, I did not know about this command.  Here's the output I get:


name                                 object ID substitute
font                      substitute font file
------------------------------------ ---------
------------------------------------ ------------------------------------
Courier                                   7  0 Nimbus Mono L Bold
/usr/local/share/fonts/ghostscript/fonts/n022004l.pfb
Courier-Bold                              8  0 Nimbus Mono L Bold
/usr/local/share/fonts/ghostscript/fonts/n022004l.pfb
Courier-Oblique                           9  0 Nimbus Mono L Regular
Oblique /usr/local/share/fonts/ghostscript/fonts/n022023l.pfb
Courier-BoldOblique                      10  0 Nimbus Mono L Bold
Oblique /usr/local/share/fonts/ghostscript/fonts/n022024l.pfb

Pierre-Luc
_______________________________________________
poppler mailing list
poppler at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler
poppler Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/poppler>
lists.freedesktop.org
Subscribing to poppler: Subscribe to poppler by filling out the following form. Use of all freedesktop.org lists is subject to our Code of ...



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20170706/1c5c307d/attachment.html>


More information about the poppler mailing list