Bug 67802 - Broken PostScript printing of Latin text with ligatures
Summary: Broken PostScript printing of Latin text with ligatures
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: Other Linux (All)
: high major
Assignee: Khaled Hosny
URL:
Whiteboard: target:4.3.0 target:4.2.0.0.beta2 tar...
Keywords: bibisected, regression
: 71869 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-05 20:08 UTC by crxssi
Modified: 2015-12-17 07:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Scan of printed samples showing correct output and broken output (77.44 KB, image/png)
2013-08-05 20:08 UTC, crxssi
Details
Dejavu postscript from LO 4.1 "print to file" which renders ANYWHERE showing the issue (26.09 KB, application/postscript)
2013-08-05 20:11 UTC, crxssi
Details
Commit Range (176.90 KB, text/plain)
2013-08-06 03:51 UTC, Joel Madero
Details
Test pdf of all fonts with PDF printing (so they look correct) (1.65 MB, application/pdf)
2013-10-29 23:58 UTC, crxssi
Details
Test pdf of all fonts with PS printing (597.91 KB, application/pdf)
2013-10-29 23:59 UTC, crxssi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description crxssi 2013-08-05 20:08:18 UTC
Created attachment 83680 [details]
Scan of printed samples showing correct output and broken output

Starting with LibreOffice 4.1, we get corrupted prints when using the Postscript model for printing and the document contains any of the DejaVu fonts. We cannot use the new default PDF printing model because it has unresolved major bugs (bug 61189 bug 61306 bug 61192). Please note that the DISPLAY of text on the screen using the DejaVu fonts is correct, it is the PS PRINTING that is corrupt.

The corruption varies depending on the document, but seems to be centered around the lowercase "f" character (especially if followed by "i"), as if the font metrics are broken.  Sometimes the character following the "f" is omitted and there is just a space, other times the character that is supposed to follow it will appear overlapping another character.  The manifestation of the bug is inconsistent- presenting in different ways depending on what is written.

A scan of three printouts is attached to this bug report showing the correct and incorrect output.  We are also attaching a "print to file" postscript document that when rendered using gv or other viewer, also shows the problem).

* Tested as FAIL on vanilla LO 4.1.0 64bit on RHEL 6
* Tested as FAIL on vanilla LO 4.1.0 32bit on Fedora 17
* Tested as OK   on vanilla LO 4.0.0 64bit on RHEL 6
* Tested as OK   on vanilla OO 3.2.1 64bit on RHEL 6
* Tested as OK   on vanilla OO 3.4.1 64bit on RHEL 6

It affects all the DejaVu fonts.  We have hundreds of fonts, and I am not able to test every single one, but we tested dozens and have no problems with any other fonts we have encountered so far.  We have potentially hundreds of documents with DejaVu fonts in them, making this a major (show stopper) issue for us.

Steps to reproduce:

* Load LO 4.1 on a Linux machine with CUPS printing.
* Set up a PS page printer on your system (we assume this is necessary).  Broken here on all printers- HP Laserjets of any model, Konica, Xerox, etc.
* Go into Tools-> Options-> LibreOffice-> Print-> uncheck "PDF as Standard Print Job Format" (and OK and restart LO).
* Create a document in writer that is in a DejaVu font (perhaps Sans).
* Type a bunch of words that have "fi" and perhaps "fo" in them.
* Print the document and note it being incorrect.
Comment 1 crxssi 2013-08-05 20:11:49 UTC
Created attachment 83681 [details]
Dejavu postscript from LO 4.1 "print to file" which renders ANYWHERE showing the issue
Comment 2 crxssi 2013-08-05 23:25:44 UTC
* Tested as FAIL on vanilla LO 4.1.0 64bit on Mageia 3

What is interesting about this last test is that it is NOT A POSTSCRIPT PRINTER.  It is just a "dumb" inkjet printer... but it is exhibiting the exact same behavior.
Comment 3 tmacalp 2013-08-06 00:21:42 UTC
I can confirm this bug using the above method (print-to-postscript-file, then view in gv).  Granted, this was using my compiled-from-git 4.2.0.0.alpha0+, but I saw the exact described behavior.

I still had Arch Linux's stable LO version installed, so I can confirm that it was working properly as of:
Version 4.0.4.2 (Build ID: 4.0.4.2 Arch Linux build-2)
Comment 4 Joel Madero 2013-08-06 01:21:47 UTC
Due to last comment adding keyword regression - bibisect happily accepted
Comment 5 Joel Madero 2013-08-06 01:56:56 UTC
Okay here is the bibisect:

a46ea509c2186592f3705702573dbedaea50feeb is the first bad commit
commit a46ea509c2186592f3705702573dbedaea50feeb
Author: Jean-Baptiste Lallement <jean-baptiste.lallement@canonical.com>
Date:   Tue May 7 08:31:26 2013 +0000

    source-hash-9a7603187eb5cc580d33212ee147f9ac89de55f4
    
    commit 9a7603187eb5cc580d33212ee147f9ac89de55f4
    Author:     Michael Stahl <mstahl@redhat.com>
    AuthorDate: Mon May 6 17:19:41 2013 +0200
    Commit:     Michael Stahl <mstahl@redhat.com>
    CommitDate: Tue May 7 01:41:23 2013 +0200
    
        dbaccess: remove Package_inc
    
        Change-Id: I8e6748eef04f25603851a33d049cb9585fa04cc6

:100644 100644 eb867a4a16e11b4240c83c10d384a164eb9dd4ab 3b24de4bd63bea22705de8af055542e8db93492f M	autogen.log
:100644 100644 4c3702cf21398a18e40bfba26c2ec201c6a8b673 15ac2000952656b846178ecaed08dead6f937aaa M	ccache.log
:100644 100644 5aa01a110764ff8bbb8416aa0c88f1bdd5c22c07 c8fd26b288b93c193bcd50054f6b9bebe3e01100 M	commitmsg
:100644 100644 22d21e9210fa0a62e366a3ca4559ff5072930649 01770ad39635e540938502edbb97b86e2a96c409 M	dev-install.log
:100644 100644 fb7e0f36b841d2209ebc3a763b79ebe170e2604f 074d89851f9d5e5914463c912f9fe88c9a0c5c7c M	make.log
:040000 040000 f12af32a62495cefa9ea554e86db43ba0ae13914 88461f4da1abc8f13b4996a04428e2ee6ea3107b M	opt


# bad: [4118d739dbd71e16057ea926ef3ef696025d3b67] source-hash-5bd6a5110bb812f82a81e73422a7b14851f84441
# good: [3e7462bd65e692bf0592d5b080b7716341b62a47] source-hash-1eddfce9894fd05315173744f495619189093dc7
git bisect start 'latest' 'oldest'
# good: [086c82fbd0a50dbf5dd28e8bcc7a6d702cea124e] source-hash-c74f2edfce221960fe546e88f2b3222d69d53598
git bisect good 086c82fbd0a50dbf5dd28e8bcc7a6d702cea124e
# bad: [9c55481e7358a36177d62899fa1326b76e07332f] source-hash-4c3ad94c70f98f5062bf96a6f1339992b7ec2bd1
git bisect bad 9c55481e7358a36177d62899fa1326b76e07332f
# good: [8a8dc2af4fed586bb05b9d85343b4a1621d545bf] source-hash-4f3bc8cf69bedb831d81d716274427191319fef0
git bisect good 8a8dc2af4fed586bb05b9d85343b4a1621d545bf
# good: [12b32b863ad194a46a7a5983a3e7850fb3fe779e] source-hash-35cd784f0635186910ddd35e25f47a2ed79d29ab
git bisect good 12b32b863ad194a46a7a5983a3e7850fb3fe779e
# bad: [583c7ada942064994fdfb6da9fa06b7556b99938] source-hash-b4a74af711b9645533f1c98476667fcec9d84bdc
git bisect bad 583c7ada942064994fdfb6da9fa06b7556b99938
# bad: [097c8cd2e7db185e437f7d2d193975f908ffac75] source-hash-a71b30f6c20197eb07249aa91a85c83eb3d4fb2d
git bisect bad 097c8cd2e7db185e437f7d2d193975f908ffac75
# good: [32187e43966523317ef55793a968ceb78710ffa1] source-hash-3def5194ddaf9c4d766b71527874bd1a973b43e5
git bisect good 32187e43966523317ef55793a968ceb78710ffa1
# bad: [c05f55fdf83e84ab587a62f79cc333b1b739eeef] source-hash-5a8f5914c2077fe330d713a5d3a2be3b3f6a7e9a
git bisect bad c05f55fdf83e84ab587a62f79cc333b1b739eeef
# bad: [a46ea509c2186592f3705702573dbedaea50feeb] source-hash-9a7603187eb5cc580d33212ee147f9ac89de55f4
git bisect bad a46ea509c2186592f3705702573dbedaea50feeb
Comment 6 Joel Madero 2013-08-06 02:31:26 UTC
The PS and PDF output is completely independent of what printer you have installed - you can have no printer installed and still create a ps file
Comment 7 crxssi 2013-08-06 03:18:16 UTC
(In reply to comment #6)
> The PS and PDF output is completely independent of what printer you have
> installed - you can have no printer installed and still create a ps file

I suspected that when my attached "print to file" PS file ended up with the same issues viewed with gv (ghostview) as I got when it was actually printed.  But was trying to cover all bases since I wasn't sure if it was somehow involving Ghostscript in the creation (which it apparently isn't).

(Don't think I will ever really understand the whole "bibisect" thing, but thanks for jumping on it so quickly.)
Comment 8 Joel Madero 2013-08-06 03:47:02 UTC
It just narrows down the range of commits which caused the problem :) So with that bibisect hopefully it narrows down the commits so we can figure out who and what broke it.
Comment 9 Joel Madero 2013-08-06 03:51:18 UTC
Created attachment 83688 [details]
Commit Range

I *think* I did this right - attached are the commits - one of these I believe caused the problem
Comment 10 tmacalp 2013-08-13 20:01:15 UTC
This seems to be one of the more nasty bugs I've seen recently because it's far-reaching and sneaky. I know it has only been a week and I don't want to be pushy, but has any progress been made on this bug?  Any possibility of this fix getting into 4.1.1 or at least 4.1.2?

* It will mysteriously ruin printing/pdf export for MANY documents.  LibreOffice (at least under Linux) defaults to DejaVu Sans for all fonts it doesn't have installed locally.  This bug will affect any documents created with odd or proprietary fonts on other systems. 

* It only drops out certain letters, so it's not horribly noticeable, but gives the impression that the author simply made unprofessional typing errors.

Based on the bug prioritization flowchart, I'd argue that this bug is "Major High" because it "involves a serious glitch."  Users are unable to accurately print MANY documents, especially those generated by MS Windows.  Please change back if I interpreted that wrong.
Comment 11 crxssi 2013-08-13 20:31:23 UTC
(In reply to comment #10)
> LibreOffice (at least under Linux) defaults to DejaVu Sans for all fonts it
> doesn't have installed locally.  This bug will affect any documents created
> with odd or proprietary fonts on other systems. 

Yikes, we just discovered this a few days ago too and I forgot to add it to this bug.  Indeed, tons of our old, old documents are now "corrupted" because when a font is not found, LO is silently and secretly using DejaVu fonts and those are corrupted when the user prints them.  And many of the documents are horribly formatted so if the user tries to change the font to something "known", the document falls apart (due to poor document construction).

Some of my users are now even dropping completely out of LO rollout beta testing because they can't do their daily work anymore :(  I agree this is a "major" regression/bug.  For us it is one of a few new "showstoppers".
Comment 12 Joel Madero 2013-08-13 21:08:51 UTC
No - and in one week to expect anything is not realistic. Most of our developers are volunteers with lives outside of LibreOffice - the bug isn't even assigned as of yet. The bug is marked as a regression and it is triaged correctly - developers are aware and hopefully someone will volunteer to take it soon. 

The code is all open source so if you or someone you know knows how to develop feel free to submit a patch. Else, donations to help the project always appreciated. Beyond that, patience is appreciated as we're all overloaded with work
Comment 13 Joel Madero 2013-08-13 21:11:53 UTC
just for a further two cents:

as for comments about people leaving LibreOffice - if this is the case it's unfortunate but again we're overloaded and if instead of "just being a user" people took the steps to become a contributor (either in development or in one of the other teams not requiring programming skills) like the dedicated few of us do - the process would run smoother and we wouldn't be nearly as overloaded as we currently are. Furthermore, I suspect most if not all of these users who flee avoid donating to the project - sorry but it's important to understand the difference between free( gratis ) and free as in FLOSS (libre), I recommend everyone reading this become aware of it:

http://en.wikipedia.org/wiki/Gratis_versus_libre
Comment 14 crxssi 2013-08-13 22:25:49 UTC
(In reply to comment #13)
> as for comments about people leaving LibreOffice - if this is the case it's
> unfortunate but again we're overloaded

Fortunately it is just a few of the users, I still have 8 left testing.  Even found and reported a few new minor bugs today because they are still testing.  I can't blame the few that left and reverted back to OO 3.2.1/3.4.1, since they have stuff they just have to get done with lots of old documents.

We appreciate all the work that is done by the LO team and I do explain to my users that it is a huge project and can take time (and the nature of FOSS).  We are keeping our fingers crossed...  I am trying to supply the highest quality reports we can in hopes that it helps.

On a lighter note, we have internally renamed this issue the "major fe-fi-fo-fum regression" because of the way it seems to affect mostly f + vowel constructs.  :)  "I smell the blood of an Englishman, Be he live, or be he dead I'll grind his bones to make my bread."
Comment 15 crxssi 2013-08-27 20:02:38 UTC
(In reply to comment #10)

> * It will mysteriously ruin printing/pdf export for MANY documents. 

I must point out that it does not affect PDF export or printing using the PDF model.  It affects printing with Postscript only.  For us, that is a major issue because we are unable to use the PDF model due to other major bugs.
Comment 16 crxssi 2013-09-04 14:31:14 UTC
Still broken in 4.1.1.2 (tested today)
Comment 17 Joel Madero 2013-09-04 15:31:09 UTC
When it's fixed you'll see a) someone assigned to the bug and b)a keyword entry for what version you'll see the fix. Until then, it'll almost definitely continue to be broken
Comment 18 tmacalp 2013-09-19 19:28:18 UTC
(In reply to comment #15)
> (In reply to comment #10)
> 
> > * It will mysteriously ruin printing/pdf export for MANY documents. 
> 
> I must point out that it does not affect PDF export or printing using the
> PDF model.  It affects printing with Postscript only.  For us, that is a
> major issue because we are unable to use the PDF model due to other major
> bugs.

Sorry, you're right.  It does only affect Postscript printing.  I thoroughly confused this bug up with one of the PDF print engine bugs.  I still do believe that it is very important for those of us still using Postscript printing.
Comment 19 crxssi 2013-10-08 20:03:14 UTC
I initially only tested this issue under Writer.  But it does affect Calc and Draw also.
Comment 20 tmacalp 2013-10-29 21:57:51 UTC
It seems this bug is even more nasty than originally thought.  It ruins postscript printing for most of the new MS Office core fonts as well.

I've noticed it affecting Calibri, Candara, Corbel, and Constantia with the same errors.
Comment 21 crxssi 2013-10-29 23:56:26 UTC
(In reply to comment #20)
> It seems this bug is even more nasty than originally thought.  It ruins
> postscript printing for most of the new MS Office core fonts as well.
> 
> I've noticed it affecting Calibri, Candara, Corbel, and Constantia with the
> same errors.

Confirmed. :(

I loaded all the core MS fonts and the issue shows on most of those also.  To better illustrate, I created a spreadsheet with all the TTF fonts we have installed (Linux traditional fonts, LO fonts, MS Fonts, lots from Corel/WP, and some other ones).  I generated a PDF with PDF printing turned on and attached it as "lofontbug.pdf" (it also has the original ods file attached inside it if someone else wants to print it from an original LO file).  Then printed it with PS printing and scanned it to a bitmap PDF called "lofontbug-scan.pdf" and attached that too to show the results of the LO font regression.
Comment 22 crxssi 2013-10-29 23:58:07 UTC
Created attachment 88326 [details]
Test pdf of all fonts with PDF printing (so they look correct)

This PDF also contains the original ODS file that created the PDF.
Comment 23 crxssi 2013-10-29 23:59:02 UTC
Created attachment 88327 [details]
Test pdf of all fonts with PS printing

Printed it with PS printing then scanned it back in as a bitmap to show the results of the LO regression on a variety of fonts.
Comment 24 bugs.libreoffice.11.2013 2013-11-21 11:36:22 UTC
I can confirm that these bug still exists in version LibreOffice 4.1.3.2 410m0(Build:2) (tested today at openSuSE with different users). 

Problem does not occur in version 4.0-3. Is there any solution available for 4.1? 

Printing with PDF-driver does result in lower quality, so this is not usable for us.
Comment 25 Khaled Hosny 2013-11-21 18:06:07 UTC
FWIW, this is likely to be an old bug that is now affects Latin text because ligatures are enabled by default on Linux (so it probably affected Mac users or complex text scripts in the past), it seems to be similar to bug 62846 (except that the other one affects text extraction only but not the rendering).
Comment 26 Khaled Hosny 2013-11-21 21:24:09 UTC
*** Bug 71869 has been marked as a duplicate of this bug. ***
Comment 27 Khaled Hosny 2013-11-21 21:26:51 UTC
I pushed a commit to master that should fix this, I appreciate if someone else can test it before pushing to 4.2 and 4.1 branches.
Comment 28 Commit Notification 2013-11-21 21:34:08 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=856ceb2cc5d78c36c7a8fc6118254d85f990d7e6

fdo#67802: Fix PS printing of non-CTL text with ligatures



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 29 crxssi 2013-11-22 17:18:14 UTC
(In reply to comment #27)
> I pushed a commit to master that should fix this, I appreciate if someone
> else can test it before pushing to 4.2 and 4.1 branches.

I downloaded LibreOfficeDev_4.3.0.0.alpha0_Linux_x86-64 daily, dated 11/22/2013, and loaded the test document in it and printed it with Postscript.  There are no more font corruptions on any of the fonts!!!  Great job and thank you so much!!!
Comment 30 Commit Notification 2013-11-22 17:56:51 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=29e5d00bba1bd4a547b36f111e2e7922922f8fb7&h=libreoffice-4-2

fdo#67802: Fix PS printing of non-CTL text with ligatures


It will be available in LibreOffice 4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 31 Commit Notification 2013-11-25 11:24:51 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cfcd8112c0cb459646ea8c17bd889c945e75f3a5&h=libreoffice-4-1

fdo#67802: Fix PS printing of non-CTL text with ligatures


It will be available in LibreOffice 4.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 32 Robinson Tryon (qubit) 2015-12-17 07:22:43 UTC Comment hidden (obsolete)