Bug 26143 - Regression bug with cairo and Type 3 user-fonts
Summary: Regression bug with cairo and Type 3 user-fonts
Status: RESOLVED NOTOURBUG
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL: http://bugs.launchpad.net/ubuntu/+sou...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-20 11:59 UTC by Dennis Sheil
Modified: 2010-01-24 04:39 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Dennis Sheil 2010-01-20 11:59:13 UTC
An Ubuntu user filed a bug on Ubuntu launchpad saying that a character in their PDF file would display via evince, but when the file was printed (or even print previewed), only part of the character would disappear.  In their case, the character was the fraction 1/2, and the numerals would disappear when printing.

I loaded the page (page 9) in epdfview, another application like evince which uses poppler as a library.  Epdfview also could see the fraction in the window, but when it printed the page, the fraction did not print.

I tested this on my machine and had the same result.  Someone else tested this on  the development version of Ubuntu (lucid) and had the same result.  So three people see the same issue.

I also tested this against the latest git code (commit 442894d371879a6bf2adb5a39b9dd0a49e76e4ac on January 15, 2010).  It is still broken.

This is a regression error.  Against poppler libraries prior to commit a3edfa30680864b95a5196c5619846de42980857, the fraction shows up when printing or print previewing.  On and after that commit, the fraction stops showing up.  I suspect this problem doesn't just affect this character in this PDF, but probably a range of Type 3 fonts.

The bug reproducing PDF is here -
http://launchpadlibrarian.net/38042138/formula_book_mf2.pdf .  The page this shows up on is page 9.  It is a 1/2 fraction within the right-most column, three rows down (or four, if you count the table on the top row).

The a3ed...0857 commit which broke this was committed November 1, 2008.  The comment field of the bad commit is "Implement Type 3 fonts in cairo backend using cairo user-fonts".

To reiterate - the problem does not happen on the screen display, only when printing (or print previewing).  It works when linked to the poppler library prior to the a3ed...0857 commit, when linking against the a3ed...0857 poppler library and later, it does not work.
Comment 1 James Cloos 2010-01-21 07:30:21 UTC
Against what version of cairo were the tests done?  Did anyone try cairo master?
Comment 2 madbiologist 2010-01-23 01:01:12 UTC
G'day James,

I'm the person mentioned in paragraph 3 of the description who tested this on the development version of Ubuntu (Lucid Lynx 10.04).

My libcairo2 version is 1.8.8-2ubuntu2.  Package details are:

Changelog

cairo (1.8.8-2ubuntu2) lucid; urgency=low

  * debian/patches/90_git_change_fix_binary_mode_new_lines_bug.dpatch:
    - git change to fix a pdf printing issue, thank Adrian Johnson
      (lp: #419143)
 -- Sebastien Bacher < seb128@ubuntu.com>   Wed, 06 Jan 2010 10:59:01 +0100

As for trying cairo master, I'm not good at compiling from git/SVN/CVS, but if you want to provide detailed step-by-step instructions I'll give it a try.  I guess the first step would be to install libcairo2-dev?

I'm not sure if this matters, but there is a newer version of libpixman-1-0 (0.16.4-1) available than the one I am using (0.16.2-1).  Would installing this help?
Comment 3 James Cloos 2010-01-23 06:59:25 UTC
> My libcairo2 version is 1.8.8-2ubuntu2.

I suspected a 1.8 version.  I did give it a try using cairo, poppler and
evince master, and got what is likely the same result.  (My poppler and
evince are a bit out of date — master as of dec 1st — but cairo was up
to date when I tested.)  The gtk libs were also a bit old.

I had evince print to file and generated each of pdf, ps and svg.

When I view the resulting pdf in mupdf (cf http://mupdf.com) the third
page has the glyphs /one and /two on top of each other, centered on the
(landscape) page at something on the order of 500 points.  The /one and
the /two seem to be from the line showing the results of tan(θ ± φ),
from the [(θ ± φ) ≠ (k + ½)π] part of the formula.

Every other viewer I tried, including ghostscript’s rendering of the ps,
failed to show the oversized /one and /two.

Using poppler’s splash backend via its pdftops(1) created a ps file
which worked correctly.

It appears that the software which created the original pdf used a type3
font to make a ½ glyph out of a line and the /one and /two glyphs of
Times and that it is poppler’s or cairo’s attempt to deal with that
using cairo userfonts which fails.  Probably due to layers of scaling.

You might want to open another fdo bug on this, speicfying cairo as
the product <http://bugs.freedesktop.org/enter_bug.cgi?product=cairo>,
and referencing cairo userfonts and this bug, in case the problem is
in cairo rather than how poppler interfaces with cairo usefonts.

If you do try out a full master chain, you'll want to specify a --prefix
somewhere under $HOME and turn on all debugging options when configuring.

Run the autogen.sh (or similar) script each git clone to create the
configure script, and then ./configure --help to see the options,
followed by ./configure --prefix=... ... and then make install.
Comment 4 madbiologist 2010-01-23 09:48:37 UTC
Created fdo bug #26186 in cairo.
Comment 5 Adrian Johnson 2010-01-24 04:39:58 UTC
Has been fixed in cairo bug 26186



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.