Bug 126242 - CFF glyphs with fractional coordinates gets distorted when embedded in PDF
Summary: CFF glyphs with fractional coordinates gets distorted when embedded in PDF
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: خالد حسني
URL:
Whiteboard: target:7.5.0 target:7.4.3 inReleaseNo...
Keywords:
: 99114 105979 (view as bug list)
Depends on:
Blocks: Font-Rendering PDF-Export
  Show dependency treegraph
 
Reported: 2019-07-05 11:14 UTC by medmedin2014
Modified: 2022-12-08 15:29 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
OTF Wrong drawings in exported pdf (104.70 KB, application/x-xz)
2019-07-05 11:21 UTC, medmedin2014
Details
source odt + pdf output + version + fonts (230.58 KB, application/x-xz)
2019-07-06 11:44 UTC, medmedin2014
Details
Scribus sample (40.74 KB, application/pdf)
2019-07-06 11:59 UTC, medmedin2014
Details

Note You need to log in before you can comment on or make changes to this bug.
Description medmedin2014 2019-07-05 11:14:33 UTC
Description:
I tried to use EBGaramond otf fonts in writer, but when I export to pdf, some letters have error in shapes, I tried the same font with Scribus and Microsoft word but the exported pdf look perfect without errors.

Steps to Reproduce:
1- Open writer
2- Write some text with ebgramond font, and type some capital letters like N, M, T, F, Z
3- export to pdf
4- open pdf with some viewer and zoom letters to maximum

Actual Results:
some letters have wrong shapes and are corrupted

Expected Results:
All letters should look fine


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 medmedin2014 2019-07-05 11:21:18 UTC
Created attachment 152576 [details]
OTF Wrong drawings in exported pdf
Comment 2 Roman Kuznetsov 2019-07-06 07:55:59 UTC
Please:
1. Attach your EBGaramond font here
2. Attach sample document in ODT format
3. Add info from Help->About dialog
Comment 3 medmedin2014 2019-07-06 11:44:47 UTC
Created attachment 152597 [details]
source odt + pdf output + version + fonts

Here's the font and the odt file plus the output pdf with screenshot of writer version.
Comment 4 medmedin2014 2019-07-06 11:59:26 UTC
Created attachment 152598 [details]
Scribus sample

And here's a sample of scribus pdf output using the same font, another remark is that writer deforms the output shape of font letters, they are not like scripus output.
Comment 5 QA Administrators 2019-07-07 03:41:04 UTC Comment hidden (noise)
Comment 6 Dieter 2019-10-19 09:51:52 UTC
I confirm it with

Version: 6.3.3.1 (x64)
Build-ID: f41f4c7f9507aeca13cb9df51f34d80e8ba30a99
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 7 V Stuart Foote 2019-10-19 13:38:19 UTC
This is a dupe of bug 99114 or bug 105979 where in https://bugs.documentfoundation.org/show_bug.cgi?id=105979#c12 Khaled notes "our subsetter does not support producing CFF fonts" and we get difference between PDF generated by gs printing (embedding CFF font) and our PDF export (embedding PS Type1 font).

Per 105979 this is inherited from OOo where Herbert Dürr (who implmented the CFF -> PS Type1 subsetting) comments in https://bz.apache.org/ooo/show_bug.cgi?id=43029#c88 

Caolán's https://gerrit.libreoffice.org/#/c/47607/ for bug 114704 looks to not have fully resolved issue of bug 105979 but maybe on the right track

Guess the question might be if now, 10 years on, we can fully move to CFF and drop the Type1 subsetting altogether?
Comment 8 V Stuart Foote 2019-10-19 13:39:02 UTC
*** Bug 99114 has been marked as a duplicate of this bug. ***
Comment 9 V Stuart Foote 2019-10-19 13:39:26 UTC
*** Bug 105979 has been marked as a duplicate of this bug. ***
Comment 10 QA Administrators 2022-04-22 04:01:49 UTC Comment hidden (noise)
Comment 11 sommerluk 2022-04-22 09:35:42 UTC
This bug is still present in

Version: 7.2.6.2 / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Ubuntu package version: 1:7.2.6-0ubuntu0.21.10.1
Calc: threaded
Comment 12 medmedin2014 2022-04-23 00:38:10 UTC
Repro on:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: e4243a140345a4bcd800217115b42667e277c6a3
CPU threads: 2; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 13 Commit Notification 2022-09-13 15:37:23 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a387f39de8e59d7542b74962242504b798af1362

tdf#126242: Handle fractional values when subsetting CFF

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2022-10-15 20:39:43 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/81fe821cc30a6746636350d78b4fdd88839dc21c

tdf#126242: Handle fractional values when subsetting CFF

It will be available in 7.4.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Stéphane Guillou (stragu) 2022-12-08 14:28:35 UTC
Fix verified in:

Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: ad085990b8073a122ac5222e5220f8f1d6826dcf
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Khaled!