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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to