Bug 119346 - Rotated text is displaced in PDF when font fallback is used
Summary: Rotated text is displaced in PDF when font fallback is used
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 124713 (view as bug list)
Depends on:
Blocks: PDF-Export Vertical-Text
  Show dependency treegraph
 
Reported: 2018-08-18 15:02 UTC by vaaydayaasra
Modified: 2024-05-05 13:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
PDF with displaced Arabic text (10.96 KB, application/pdf)
2018-08-18 15:04 UTC, vaaydayaasra
Details
Screenshot of Writer document view (122.89 KB, image/png)
2018-08-18 15:05 UTC, vaaydayaasra
Details
ODT document used to create the screenshot and the PDF (9.25 KB, application/vnd.oasis.opendocument.text)
2018-08-18 15:06 UTC, vaaydayaasra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vaaydayaasra 2018-08-18 15:02:42 UTC
Description:
In this example, I created a document with a few Arabic-script characters (U+08A2, U+08A3 & U+08A4), which were quite recently added to Unicode for various Arabic-script African languages such as Fulfulde. The font I had used in the rest of the document was DejaVu Sans, so I used that font setting even for these characters. In reality, these glyphs are not found in DejaVu Sans but had to be substituted from another font, in my case Scheherazade (from fonts-sil-scheherazade, available through packages.sil.org). After rotating the letters by 90 degrees, everything looked fine on the screen but when I created a PDF, everything was displaced about one inch upwards and one inch to the left. See the attached screenshot, where everything looks fine, and the PDF where all the letters are displaced.

If I change the font setting for this text to Scheherazade, everything looks fine even in a generated PDF. So apparently LibreOffice gets confused by the different font metrics of the two fonts, the one selected by the user and the one used as the real source for the glyphs.

This bug was first reported on Launchpad for LO 5.4.6.2 on Ubuntu 17.10 at: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1774244 . After my initial report, I have upgraded to LO 6.0.3.2 and can still reproduce the problem. Another user on Launchpad confirmed the bug on LO 6.0.3.2 and 6.1.0.3 on Ubuntu 18.04, as well.

Steps to Reproduce:
1. In a new Writer document, type Arabic characters that are not present in the default font (in my example "ࢢࢣࢤ").
2. Select the text and rotate it by 90 degrees through the Font properties dialog.
3. Generate a PDF.

Actual Results:
In the generated PDF, the text is displaced one inch to the left and one inch upwards. In Writer everything looks fine.

Expected Results:
The generated PDF should look the same as the document view in Writer.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.0.3.2
Build ID: 1:6.0.3-0ubuntu1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Comment 1 vaaydayaasra 2018-08-18 15:04:48 UTC
Created attachment 144267 [details]
PDF with displaced Arabic text
Comment 2 vaaydayaasra 2018-08-18 15:05:51 UTC
Created attachment 144268 [details]
Screenshot of Writer document view
Comment 3 vaaydayaasra 2018-08-18 15:06:26 UTC
Created attachment 144269 [details]
ODT document used to create the screenshot and the PDF
Comment 4 Buovjaga 2018-09-10 10:49:26 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2019-09-11 04:38:13 UTC Comment hidden (obsolete)
Comment 6 vaaydayaasra 2019-10-07 15:40:00 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2021-10-07 03:53:26 UTC Comment hidden (obsolete)
Comment 8 vaaydayaasra 2022-03-01 19:22:36 UTC Comment hidden (obsolete)
Comment 9 vaaydayaasra 2022-03-01 20:43:20 UTC Comment hidden (obsolete)
Comment 10 ⁨خالد حسني⁩ 2022-12-04 20:29:44 UTC
FWIW, this seems to be related to font fallback. If the selected font supports Arabic, the text is exported correctly.
Comment 11 ⁨خالد حسني⁩ 2022-12-28 18:25:55 UTC
*** Bug 124713 has been marked as a duplicate of this bug. ***
Comment 12 ⁨خالد حسني⁩ 2022-12-28 18:27:55 UTC
Bug 124713 has an example not involving Arabic text at all. It seems to depend entirely on the fact that a fallback font is used or not.
Comment 13 vaaydayaasra 2024-05-05 13:41:53 UTC
Still repro on:

Version: 7.6.6.3 (X86_64) / LibreOffice Community
Build ID: 60(Build:3)
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: fi-FI
Ubuntu package version: 4:7.6.6-0ubuntu0.23.10.1
Calc: threaded