Bug 153877 - vertical Unicode SMP chars not displayed correctly when exported as PDF
Summary: vertical Unicode SMP chars not displayed correctly when exported as PDF
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks: Vertical-Text
  Show dependency treegraph
 
Reported: 2023-02-28 06:57 UTC by Danny Lin
Modified: 2023-03-18 18:01 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Demo ODT file (11.24 KB, application/vnd.oasis.opendocument.text)
2023-02-28 06:58 UTC, Danny Lin
Details
Rendering of the demo ODT file, which seems normal (83.20 KB, image/png)
2023-02-28 06:58 UTC, Danny Lin
Details
Rendering of the exported PDF of the demo ODT file, which seems corrupted (26.52 KB, image/png)
2023-02-28 06:59 UTC, Danny Lin
Details
PDF export in vertical layout with LO 7.6 alpha (10.00 KB, application/pdf)
2023-03-14 09:26 UTC, Stéphane Guillou (stragu)
Details
updated test document, right-to-left vertical, copy using FSung-m font (12.64 KB, application/vnd.oasis.opendocument.text)
2023-03-15 09:13 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Lin 2023-02-28 06:57:48 UTC
Description:
Vertical Unicode SMP chars are not displayed correctly in a PDF file exported from an ODT.

Steps to Reproduce:
1. Install font `全宋體` (download: https://drive.google.com/file/d/1m0-WYAXbEz3lxJrti25ZvWv6LkHjMp2X/view, official page: http://fgwang.blogspot.com/2023/02/blog-post.html).
2. Open the attached demo file unifont.odt.
3. Export the file as PDF and open it with Google Chrome.

Actual Results:
The chars 𠀀 (U+20000), 𮯠 (U+2EBE0), 𰀀 (U+30000), 𲎯 (U+323AF) in the PDF are not displayed correctly.

Expected Results:
All chars in the PDF should be displayed correctly as in the LO Writer.


Reproducible: Always


User Profile Reset: No

Additional Info:
Related bug: #107488
Comment 1 Danny Lin 2023-02-28 06:58:21 UTC
Created attachment 185629 [details]
Demo ODT file
Comment 2 Danny Lin 2023-02-28 06:58:51 UTC
Created attachment 185630 [details]
Rendering of the demo ODT file, which seems normal
Comment 3 Danny Lin 2023-02-28 06:59:25 UTC
Created attachment 185631 [details]
Rendering of the exported PDF of the demo ODT file, which seems corrupted
Comment 4 Stéphane Guillou (stragu) 2023-03-14 09:25:36 UTC
I installed all the TTF fonts from the archive you linked.
Even though the font "全宋體(調和)" is still displayed as unavailable in LibreOffice, the fallback seems to work and the characters are displayed properly in the example file.

I can then export the PDF and still see the characters displayed properly in left-to-right (horizontal) text direction. However, in right-to-left (vertical) text direction, the PDF export shows the same shifted characters.

Using pdffonts on my PDF export shows me:

name               type         encoding     emb sub uni object ID
------------------ ------------ ------------ --- --- --- ---------
BAAAAA+FSung-p     TrueType     WinAnsi      yes yes yes      9  0
CAAAAA+FSung-2     TrueType     WinAnsi      yes yes yes     14  0
DAAAAA+FSung-3     TrueType     WinAnsi      yes yes yes     19  0

Tested with:

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

6.0 was sensibly worse, but OOo 3.3 does not have that shift, so marking as regression.

Khaled, any idea what might be going on here?
Comment 5 Stéphane Guillou (stragu) 2023-03-14 09:26:27 UTC
Created attachment 185945 [details]
PDF export in vertical layout with LO 7.6 alpha
Comment 6 ⁨خالد حسني⁩ 2023-03-14 18:18:11 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> Khaled, any idea what might be going on here?

No idea, if font fallback is involved, PDF export seems to do some weird things for vertical text, e.g. bug 119346.
Comment 7 Stéphane Guillou (stragu) 2023-03-15 09:13:08 UTC
Created attachment 185969 [details]
updated test document, right-to-left vertical, copy using FSung-m font

Thanks Khaled.

I tested by copying the same characters in another line, changing the font to one installed (FSung-m) and exporting again, and I get the same issue. So I don't think it is related to fallback fonts.