Bug 38976 - Text disappearing when rendering a pdf onto a cairo pdf surface
Summary: Text disappearing when rendering a pdf onto a cairo pdf surface
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: pdf backend (show other bugs)
Version: 1.10.2
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: Adrian Johnson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-05 05:42 UTC by michael
Modified: 2011-07-06 06:06 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
the source file that won't work (69.58 KB, application/pdf)
2011-07-05 05:42 UTC, michael
Details
testcase - modified version of pdf2png.c (2.99 KB, text/plain)
2011-07-05 05:43 UTC, michael
Details
Version of original pdf that works fine (some letters removed) (69.26 KB, application/pdf)
2011-07-06 00:13 UTC, michael
Details
result of pdf2pdf on #48771 (8.73 KB, application/pdf)
2011-07-06 02:18 UTC, michael
Details
result of pdf2pdf on the version that works (with letters removed) (8.42 KB, application/pdf)
2011-07-06 02:23 UTC, michael
Details

Description michael 2011-07-05 05:42:51 UTC
Created attachment 48771 [details]
the source file that won't work

Text disappearing when rendering a pdf onto a cairo pdf surface
Comment 1 michael 2011-07-05 05:43:56 UTC
Created attachment 48772 [details]
testcase - modified version of pdf2png.c
Comment 2 michael 2011-07-06 00:13:29 UTC
Created attachment 48800 [details]
Version of original pdf that works fine (some letters removed)
Comment 3 michael 2011-07-06 00:14:50 UTC
There was a bug before that I reported, where I believe some characters weren't properly encoded in cairo and was interpreted as PS/PDF codes in the final document; i'm not quite sure about this though, as I can't find the bug report anymore... I know that my old test case works now though, so some things are fixed.
Comment 4 Adrian Johnson 2011-07-06 02:11:18 UTC
Testing your source file with your modified pdf2png and cairo 1.10.2 and poppler 0.16.4 works for me.

Please attach your output files from both PDFs.
Comment 5 michael 2011-07-06 02:18:58 UTC
Created attachment 48807 [details]
result of pdf2pdf on #48771
Comment 6 michael 2011-07-06 02:23:51 UTC
Created attachment 48808 [details]
result of pdf2pdf on the version that works (with letters removed)
Comment 7 michael 2011-07-06 02:29:01 UTC
I'm using poppler 0.16.6

I'm viewing the pdfs in adobe acrobat 9
Comment 8 Adrian Johnson 2011-07-06 02:31:40 UTC
The status in pdf2png is not set before it is printed. Could you add the line:

    status = cairo_surface_status (surface);

after cairo_surface_finish() and see if any error is printed.
Comment 9 michael 2011-07-06 02:58:13 UTC
(In reply to comment #8)
> The status in pdf2png is not set before it is printed. Could you add the line:
>     status = cairo_surface_status (surface);
> after cairo_surface_finish() and see if any error is printed.

No error (nothing) printed.
Comment 10 Adrian Johnson 2011-07-06 05:53:04 UTC
The CFF fallback font in your PDF is corrupt. There is a 1 byte difference between the CFF font in your PDF and the CFF font in my PDF generated from the same test case. The difference is in one element of an offset array inside the font. The array contents are identical so cairo must know the correct size of the array elements. But one number in the array of offsets that point to the contents of the array is 0 instead of 14. I have no idea what could be causing this difference. I can not see any thing in the code that could cause this.
Comment 11 Adrian Johnson 2011-07-06 06:06:37 UTC
I just noticed I was testing with current 1.10 branch instead of 1.10.2. I can reproduce the bug with 1.10.2 but not with the latest 1.10 branch. Valgrind shows what the problem is. It has already been fixed with this commit:

http://cgit.freedesktop.org/cairo/commit/?h=1.10&id=684fff7a498dec0ccfde0f3b9edc48ca0cdf2c20


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.