[cairo-bugs] [Bug 52280] PDF font substitution error, libcairo 1.12

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jul 21 01:05:33 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=52280

Adrian Johnson <ajohnson at redneon.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |NOTABUG

--- Comment #3 from Adrian Johnson <ajohnson at redneon.com> 2012-07-21 01:05:33 PDT ---
The original pdf contains the following fonts:

$ pdffonts bug52280.pdf 
name                                 type              encoding         emb sub
uni object ID
------------------------------------ ----------------- ---------------- --- ---
--- ---------
Arial,Bold                           CID TrueType      Identity-H       no  no 
no     103  0
Arial                                CID TrueType      Identity-H       no  no 
no     104  0
Arial-BoldMT                         TrueType          WinAnsi          no  no 
no     105  0
ArialMT                              TrueType          WinAnsi          no  no 
no     106  0
Helvetica-Bold                       Type 1            Custom           no  no 
no       2  0
Helvetica                            Type 1            Custom           no  no 
no       4  0
Helvetica                            Type 1            Custom           no  no 
no     154  0
Helvetica                            Type 1            Custom           no  no 
no     150  0


None of the fonts are embedded. So poppler will substitute the fonts. The
substituted fonts are:

$ pdffonts -subst bug52280.pdf 
name                                 object ID substitute font                 
    substitute font file
------------------------------------ ---------
------------------------------------ ------------------------------------
Arial,Bold                              103  0 Liberation Sans Bold            
    /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf
Arial                                   104  0 Liberation Sans                 
    /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf
Arial-BoldMT                            105  0 Liberation Sans Bold            
    /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf
ArialMT                                 106  0 Liberation Sans                 
    /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf
Helvetica-Bold                            2  0 Nimbus Sans L Bold              
    /usr/share/fonts/X11/Type1/n019004l.pfb
Helvetica                                 4  0 Nimbus Sans L                   
    /usr/share/fonts/X11/Type1/n019003l.pfb
Helvetica                               154  0 Nimbus Sans L                   
    /usr/share/fonts/X11/Type1/n019003l.pfb
Helvetica                               150  0 Nimbus Sans L                   
    /usr/share/fonts/X11/Type1/n019003l.pfb


Poppler will substitute the Helvetica fonts with Nimbus Sans. When rendering
the pdf to pdf with pdftocairo cairo will embed the substituted fonts in the
output pdf. Note that cairo does not support creating pdf files with non
embedded fonts.

$ pdftocairo -pdf bug52280.pdf out.pdf
$ pdfinfo out.pdf
Creator:        cairo 1.12.3 (http://cairographics.org)
Producer:       cairo 1.12.3 (http://cairographics.org)
Tagged:         no
Pages:          1
Encrypted:      no
Page size:      612 x 1008 pts
File size:      47914 bytes
Optimized:      no
PDF version:    1.5
$ pdffonts out.pdf 
name                                 type              encoding         emb sub
uni object ID
------------------------------------ ----------------- ---------------- --- ---
--- ---------
JWYQNF+LiberationSans-Bold           TrueType          WinAnsi          yes yes
yes      5  0
FQNIOC+LiberationSans                TrueType          WinAnsi          yes yes
yes      6  0
EXPAHP+NimbusSanL-Bold               Type 1            WinAnsi          yes yes
yes      7  0
BKHCZG+NimbusSanL-Regu               Type 1            WinAnsi          yes yes
yes      8  0

This is all working correctly. The output pdf displays correctly in acroread
and evince. The three identical Nimbus fonts have been merged into one.

Testing with cairo 1.10.2:

$ pdftocairo -pdf bug52280.pdf out.pdf
$ pdfinfo out.pdf
Creator:        cairo 1.10.2 (http://cairographics.org)
Producer:       cairo 1.10.2 (http://cairographics.org)
Tagged:         no
Pages:          1
Encrypted:      no
Page size:      612 x 1008 pts
File size:      91922 bytes
Optimized:      no
PDF version:    1.5
$ pdffonts out.pdf 
name                                 type              encoding         emb sub
uni object ID
------------------------------------ ----------------- ---------------- --- ---
--- ---------
JWYQNF+LiberationSans-Bold           CID TrueType      Identity-H       yes yes
yes      5  0
FMRFXL+LiberationSans                CID TrueType      Identity-H       yes yes
yes      6  0
VGBHBI+NimbusSansL                   Type 1            Builtin          yes yes
yes      7  0
LBBITE+NimbusSansL                   Type 1            Builtin          yes yes
yes      8  0

Again the Nimbus Sans fonts are embedded. The difference in encoding is due to
a change in the way cairo 1.12 does the font subsetting. There is no difference
in the rendering of the 1.10 output in acroread or evince compared to 1.12.

The missing '-Bold' and '-Regular' from the Nimbus Sans font names is due to a
change in how cairo extracts the font name from Type 1 fonts. In cairo 1.10 it
was using the family name. In cairo 1.12 it uses the full name.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the cairo-bugs mailing list