Bug 71151 - PDF documents using Charter Type 1 font not printed and previewed correctly
Summary: PDF documents using Charter Type 1 font not printed and previewed correctly
Status: RESOLVED DUPLICATE of bug 70364
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-02 00:18 UTC by Germán Poo-Caamaño
Modified: 2013-11-02 02:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
PDF Test Case (17.90 KB, text/plain)
2013-11-02 00:18 UTC, Germán Poo-Caamaño
Details

Description Germán Poo-Caamaño 2013-11-02 00:18:18 UTC
Created attachment 88522 [details]
PDF Test Case

As reported in https://bugzilla.gnome.org/show_bug.cgi?id=710777:


--------------------------------------------------------
Some PDFs embedding the free Charter Type 1 font
(http://www.ctan.org/tex-archive/fonts/charter/) are not printed correctly and
are not displayed correctly in the print preview opened from Evince.  In
particular, the problems are:

Printing:

 1. The dots over German umlauts are missing.
 2. Certain letters (for example, all bold 'M' or all bold 'r' in the document)
are replaced by two small dots.
 3. Sometimes, the whole text typeset in the regular Charter font (non-bold,
non-italic) is printed in a different font (which looks like Times to my eyes).

Print preview:

 4. German umlauts are not visible.
 5. Sometimes, the previewer simply crashes.

The normal display in Evince is not affected.

All documents I have tested are displayed and printed correctly by xpdf,
Ghostscript, Acrobat Reader on Win7, and Apple Preview on OSX.

I have not observed such problems with PDFs using other embedded Type 1 fonts
(among others, I tested URW Palladio L and Latin Modern).

The bug seems to be somehow triggered by documents containing accented
characters, such as German umlauts.  It's not easy to see, though, what exactly
triggers it.  I have created a small test document, which exhibits problems 1.
and 4.; it is available at:

   
https://drive.google.com/file/d/0BxyCjvRCPNawM2dsUW9kZUQycFE/edit?usp=sharing

Small changes in the documents can make the problems appear or disappear.  For
example, in above document, when I delete the quotation marks around the first
line of text or add quotation marks around the second line of text, Evince
prints the resulting document correctly.  This makes it difficult to create
small test documents exhibiting all cited problems (I'm sorry, but I can't
share the original documents).

I don't know exactly how printing is done in Evince, but since xpdf and
Ghostscript have no problems with these documents, I suspect that this is a bug
in Cairo.
--------------------------------------------------------
Comment 1 Germán Poo-Caamaño 2013-11-02 00:24:36 UTC
I had printed the document to a file (using poppler-glib-demo), and
indeed some glyphs were missing.  Using pdftocairo -png works fine,
but it crashed when using -pdf.  See the backtrace:

Starting program: /home/gpoo/code/evince/install/bin/pdftocairo -pdf evince-charter.pdf foo.pdf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0xb7c632bf in _cairo_winansi_to_glyphname (glyph=541348384) at cairo-type1-glyph-names.c:404
404	    if (winansi_encoding_offset[glyph])

#0  0xb7c632bf in _cairo_winansi_to_glyphname (glyph=541348384) at cairo-type1-glyph-names.c:404
#1  0xb7c63aa2 in write_used_glyphs (font=0xbfffdf00, glyph_number=55, 
    name=0x80bd8f0 "dieresis 61 RD ^3\246;\271\340\341\222m\321\340\353럩\315d\224\aW\365\263\352%\032˻\336\376q\244\230\060m\252\276\377\n1\232\032\063\206sٷ\301qǬ\342\016f\016\001\341\350\237 ND\n/germandbls 186 RD k\353.\330\004\031 \003\234\335\330\034W\231\365/T}z\304O\212\030\375\241\332\035\344\344\260\\\276\363Ku)\264\254\066Oܷ=\362\350+HY!]\325\370\200e\274 j\362\340\373G!\215ـ\213g\211W2\f\205\003-P\\\177", name_length=8, 
    charstring=0x80bd8ff "^3\246;\271\340\341\222m\321\340\353럩\315d\224\aW\365\263\352%\032˻\336\376q\244\230\060m\252\276\377\n1\232\032\063\206sٷ\301qǬ\342\016f\016\001\341\350\237 ND\n/germandbls 186 RD k\353.\330\004\031 \003\234\335\330\034W\231\365/T}z\304O\212\030\375\241\332\035\344\344\260\\\276\363Ku)\264\254\066Oܷ=\362\350+HY!]\325\370\200e\274 j\362\340\373G!\215ـ\213g\211W2\f\205\003-P\\\177", charstring_length=61) at cairo-type1-subset.c:1147
#2  0xb7c634c3 in cairo_type1_font_subset_for_each_glyph (font=0xbfffdf00, dict_start=<optimized out>, dict_end=0x80bdb4a "", 
    func=0xb7c63920 <write_used_glyphs>, dict_out=0xbfffe150) at cairo-type1-subset.c:1237
#3  0xb7c65b7d in cairo_type1_font_subset_write_private_dict (
    name=0x80b6281 "/Encoding StandardEncoding def\n/FontBBox {-161 -236 1193 963} readonly def\ncurrentdict end\ncurrentfile eexec\n\331\326oc*H\022\373\256\211\370\245\217(v\036r\261\377\305bP\203\003K>\032\334\335\340/\244\264J\350\363\247\270W\207\310", <incomplete sequence \311>, font=0xbfffdf00) at cairo-type1-subset.c:1489
#4  cairo_type1_font_subset_write (
    name=0x80b6281 "/Encoding StandardEncoding def\n/FontBBox {-161 -236 1193 963} readonly def\ncurrentdict end\ncurrentfile eexec\n\331\326oc*H\022\373\256\211\370\245\217(v\036r\261\377\305bP\203\003K>\032\334\335\340/\244\264J\350\363\247\270W\207\310", <incomplete sequence \311>, font=0xbfffdf00) at cairo-type1-subset.c:1596
#5  cairo_type1_font_subset_generate (
    name=0x80b6281 "/Encoding StandardEncoding def\n/FontBBox {-161 -236 1193 963} readonly def\ncurrentdict end\ncurrentfile eexec\n\331\326oc*H\022\373\256\211\370\245\217(v\036r\261\377\305bP\203\003K>\032\334\335\340/\244\264J\350\363\247\270W\207\310", <incomplete sequence \311>, abstract_font=0xbfffdf00) at cairo-type1-subset.c:1668
#6  _cairo_type1_subset_init (type1_subset=<optimized out>, 
    name=0x80b6281 "/Encoding StandardEncoding def\n/FontBBox {-161 -236 1193 963} readonly def\ncurrentdict end\ncurrentfile eexec\n\331\326oc*H\022\373\256\211\370\245\217(v\036r\261\377\305bP\203\003K>\032\334\335\340/\244\264J\350\363\247\270W\207\310", <incomplete sequence \311>, scaled_font_subset=0xbfffe334, hex_encode=0) at cairo-type1-subset.c:1733
#7  0xb7ca9214 in _cairo_pdf_surface_emit_type1_font_subset (font_subset=0xbfffe334, surface=0x8098640) at cairo-pdf-surface.c:5043
#8  _cairo_pdf_surface_emit_unscaled_font_subset (closure=0x8098640, font_subset=0xbfffe334) at cairo-pdf-surface.c:5570
#9  _cairo_pdf_surface_emit_unscaled_font_subset (font_subset=0xbfffe334, closure=0x8098640) at cairo-pdf-surface.c:5556
#10 0xb7c5d8ea in _cairo_sub_font_collect (closure=0xbfffe364, entry=0x80a7050) at cairo-scaled-font-subsets.c:746
#11 _cairo_scaled_font_subsets_foreach_internal (font_subsets=<optimized out>, font_subset_callback=<optimized out>, 
    closure=0x8098640, type=CAIRO_SUBSETS_FOREACH_UNSCALED) at cairo-scaled-font-subsets.c:1067
#12 0xb7ca3c1c in _cairo_pdf_surface_emit_font_subsets (surface=0x8098640) at cairo-pdf-surface.c:5612
#13 _cairo_pdf_surface_finish (abstract_surface=0x8098640) at cairo-pdf-surface.c:1949
#14 0xb7c3dcfa in _cairo_surface_finish (surface=0x8098640) at cairo-surface.c:1007
#15 0xb7c3eaa3 in *INT_cairo_surface_finish (surface=0x8098640) at cairo-surface.c:1054
#16 *INT_cairo_surface_finish (surface=0x8098640) at cairo-surface.c:1038
#17 0xb7c105a6 in _cairo_paginated_surface_finish (abstract_surface=0x8099e00) at cairo-paginated-surface.c:213
#18 0xb7c3dcfa in _cairo_surface_finish (surface=0x8099e00) at cairo-surface.c:1007
#19 0xb7c3eaa3 in *INT_cairo_surface_finish (surface=0x8099e00) at cairo-surface.c:1054
#20 *INT_cairo_surface_finish (surface=0x8099e00) at cairo-surface.c:1038
#21 0x080500cb in endDocument () at pdftocairo.cc:628
#22 main (argc=3, argv=0xbfffe6c4) at pdftocairo.cc:1042
Comment 2 Adrian Johnson 2013-11-02 01:23:24 UTC
Appears to be the same as bug 70364. Should be fixed in cairo master.
Comment 3 Germán Poo-Caamaño 2013-11-02 02:43:58 UTC
(In reply to comment #2)
> Appears to be the same as bug 70364. Should be fixed in cairo master.

Yes, it is fixed in master.  Any chance to get it backported to 1.12?

Thanks

*** This bug has been marked as a duplicate of bug 70364 ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.