Bug 113428 - Arabic PDF export is messy in old files < 5.3
Summary: Arabic PDF export is messy in old files < 5.3
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: All All
: high normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:6.0.0 target:5.4.4
Keywords: bibisected, bisected, regression
: 113529 (view as bug list)
Depends on:
Blocks: PDF-Export RTL-Arabic-and-Farsi
  Show dependency treegraph
 
Reported: 2017-10-25 05:51 UTC by Fahad Al-Saidi
Modified: 2017-11-17 14:36 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
odt file (18.75 KB, application/vnd.oasis.opendocument.text)
2017-10-25 05:51 UTC, Fahad Al-Saidi
Details
the error (454.35 KB, image/jpeg)
2017-10-25 05:51 UTC, Fahad Al-Saidi
Details
PDF output (30.25 KB, application/pdf)
2017-10-25 05:52 UTC, Fahad Al-Saidi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fahad Al-Saidi 2017-10-25 05:51:06 UTC
Created attachment 137272 [details]
odt file

I have many docs that created with Libreoffice 5.2 or even older. Now I notice that PDF export is messy. 
To test open the attached doc and try to print or export.
Comment 1 Fahad Al-Saidi 2017-10-25 05:51:51 UTC
Created attachment 137273 [details]
the error
Comment 2 Fahad Al-Saidi 2017-10-25 05:52:31 UTC
Created attachment 137274 [details]
PDF output
Comment 3 Fahad Al-Saidi 2017-10-25 05:54:31 UTC
I notice also that this problem is appear when I am using justified text.
Comment 4 Xisco Faulí 2017-10-25 10:19:34 UTC
Regression introduced by:

author	Khaled Hosny <khaledhosny@eglug.org>	2016-12-19 23:36:34 (GMT)
committer	Khaled Hosny <khaledhosny@eglug.org>	2016-12-20 05:14:25 (GMT)
commit 9eb4b14ffa57cd7bbdf0fc43096f5f1e65c8e388 (patch)
tree 535d14ede1db48f0c1651b27f0ebd78579819b47
parent 2e9c02feca732f6dd012ccbe5d7c6853c64075a5 (diff)
tdf#103765: Round positions instead of truncating

Bisected with bibisect-linux-64-5.4.

Adding Cc: to Khaled Hosny
Comment 5 Xisco Faulí 2017-11-06 18:42:10 UTC
*** Bug 113529 has been marked as a duplicate of this bug. ***
Comment 6 ⁨خالد حسني⁩ 2017-11-07 08:22:27 UTC
Hmm, that is weird! But I guess we should revert it and re-open bug 103765 until we find a better solution for since this issue is more serious than the other.
Comment 7 ⁨خالد حسني⁩ 2017-11-08 08:54:21 UTC
(In reply to Khaled Hosny from comment #6)
> Hmm, that is weird! But I guess we should revert it and re-open bug 103765
> until we find a better solution for since this issue is more serious than
> the other.

I reverted (In reply to Xisco Faulí from comment #4)
> Regression introduced by:
> 
> author	Khaled Hosny <khaledhosny@eglug.org>	2016-12-19 23:36:34 (GMT)
> committer	Khaled Hosny <khaledhosny@eglug.org>	2016-12-20 05:14:25 (GMT)
> commit 9eb4b14ffa57cd7bbdf0fc43096f5f1e65c8e388 (patch)
> tree 535d14ede1db48f0c1651b27f0ebd78579819b47
> parent 2e9c02feca732f6dd012ccbe5d7c6853c64075a5 (diff)
> tdf#103765: Round positions instead of truncating
> 
> Bisected with bibisect-linux-64-5.4.
> 
> Adding Cc: to Khaled Hosny

I reverted this commit locally (on Windows) and I still get the same buggy output, can someone else try locally?
Comment 8 Xisco Faulí 2017-11-08 14:46:01 UTC
(In reply to Khaled Hosny from comment #7)
> (In reply to Khaled Hosny from comment #6)
> > Hmm, that is weird! But I guess we should revert it and re-open bug 103765
> > until we find a better solution for since this issue is more serious than
> > the other.
> 
> I reverted (In reply to Xisco Faulí from comment #4)
> > Regression introduced by:
> > 
> > author	Khaled Hosny <khaledhosny@eglug.org>	2016-12-19 23:36:34 (GMT)
> > committer	Khaled Hosny <khaledhosny@eglug.org>	2016-12-20 05:14:25 (GMT)
> > commit 9eb4b14ffa57cd7bbdf0fc43096f5f1e65c8e388 (patch)
> > tree 535d14ede1db48f0c1651b27f0ebd78579819b47
> > parent 2e9c02feca732f6dd012ccbe5d7c6853c64075a5 (diff)
> > tdf#103765: Round positions instead of truncating
> > 
> > Bisected with bibisect-linux-64-5.4.
> > 
> > Adding Cc: to Khaled Hosny
> 
> I reverted this commit locally (on Windows) and I still get the same buggy
> output, can someone else try locally?

This is weird.
I've just tried locally as well and the issue is reproduced while reverting the commit if it's done from the UI, however from commandline it's not.
Ie: instdir/program/soffice --headless --convert-to pdf /home/xisco/Baixades/test.odt --outdir /home/xisco/Escriptori/
Comment 9 Xisco Faulí 2017-11-08 15:02:02 UTC
Ok, I've bisected it again using the UI at export time and it points me to this commit instead:

author	Khaled Hosny <khaledhosny@eglug.org>	2016-12-07 22:43:09 (GMT)
committer	Khaled Hosny <khaledhosny@eglug.org>	2016-12-10 00:58:26 (GMT)
commit b894104a0b02a9b074c76feb925389d7bee6a493 (patch)
tree 93e8a9362281f2c992f503a4e38ec17d04a9132b
parent b52167df08511239c3d08904a3d12a3c92141f38 (diff)
Pass GlyphItem around
We have this nice structure that contains (almost) all the information
we need, so pass it around instead of passing separate fragments of said
information.

The ultimate is to kill the horrible sal_GlyphId hack if encoding
various bits of information in the higher bits of a 32-bit integer.

@Khaled, Does it make more sense now?
Comment 10 ⁨خالد حسني⁩ 2017-11-08 20:47:23 UTC
(In reply to Xisco Faulí from comment #9)
> Ok, I've bisected it again using the UI at export time and it points me to
> this commit instead:
> 
> author	Khaled Hosny <khaledhosny@eglug.org>	2016-12-07 22:43:09 (GMT)
> committer	Khaled Hosny <khaledhosny@eglug.org>	2016-12-10 00:58:26 (GMT)
> commit b894104a0b02a9b074c76feb925389d7bee6a493 (patch)
> tree 93e8a9362281f2c992f503a4e38ec17d04a9132b
> parent b52167df08511239c3d08904a3d12a3c92141f38 (diff)
> Pass GlyphItem around
> We have this nice structure that contains (almost) all the information
> we need, so pass it around instead of passing separate fragments of said
> information.
> 
> The ultimate is to kill the horrible sal_GlyphId hack if encoding
> various bits of information in the higher bits of a 32-bit integer.
> 
> @Khaled, Does it make more sense now?

Yes, that makes a lot of since. I was expecting something around this area as it touched PDF export. Thank you!
Comment 11 Commit Notification 2017-11-09 08:16:34 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

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

tdf#113428: Fix glyph positions in PDF export

It will be available in 6.0.0.

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 12 Nima Dolatabadi 2017-11-09 11:24:26 UTC Comment hidden (no-value)
Comment 13 ⁨خالد حسني⁩ 2017-11-09 13:05:49 UTC Comment hidden (obsolete)
Comment 14 Commit Notification 2017-11-09 19:20:03 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=86707e80c32c8deeef9c0992ca3ff184f42faed7&h=libreoffice-5-4

tdf#113428: Fix glyph positions in PDF export

It will be available in 5.4.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 15 Xisco Faulí 2017-11-13 15:03:32 UTC
Verified in

Version: 6.0.0.0.alpha1+
Build ID: a7f961ddd88df4117de5f7c199881cf75d2905b5
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 16 Aron Budea 2017-11-17 14:36:56 UTC
*** Bug 113529 has been marked as a duplicate of this bug. ***