Bug 77490

Summary: PDF generated from vertical text has wrong character orientation for Japanese (OSX only)
Product: LibreOffice Reporter: Herouth Maoz <libreoffice>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: cpae, iplaw67, narayanaras, nate, philipz85, tabe
Priority: medium    
Version: Inherited From OOo   
Hardware: Other   
OS: macOS (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 83066, 103378, 106045    
Attachments: Example Japanese text document and resulting PDF in zip file
Actual behavior
expected behavior in Chinese

Description Herouth Maoz 2014-04-15 15:52:10 UTC
Created attachment 97417 [details]
Example Japanese text document and resulting PDF in zip file

When exporting a vertical-text document to PDF, the character orientation changes, so that it becomes a plain left-to-right document rotated by 90 degrees instead of a vertical text document.

* Create new text document.
* Paste in plain text copied from some source, say Japanese Wikipedia.
* In Format->Page change the text direction to "right-to-left (vertical)".
* Choose proper Asian font to ensure proper metrics, make sure the text flows properly from right to left (using the text direction buttons if necessary).
* Export to PDF. The characters are all rotated by 90 degrees.

An example document (content copied from the LibreOffice item in Wikipedia) and the resulting PDF are attached.
Comment 1 Yousuf Philips (jay) (retired) 2014-06-09 15:50:02 UTC
Tested the attached file in Linux Mint with LibO 3.3.0, 4.2.4, and 4.3 beta 2 and unfortunately couldnt reproduce. Also tested 4.2.4 on Windows 7 and still couldnt reproduce. Likely another mac only font issue.

@Herouth: had this been showing correctly in previous version of LibreOffice?
Comment 2 Herouth Maoz 2014-06-09 18:45:57 UTC
I haven't tested it before, so just now I downloaded a copy of LibreOffice 3.3.4 and tested the same document, and the result is the same.
Comment 3 retired 2014-06-19 10:31:52 UTC
Reproduced on OS X 10.9.3 LO4.3beta2.

The exported PDF indeed chances character orientation.

NEW and adding "osx only" to title.
Comment 4 Tobias Schlüter 2014-10-28 14:07:55 UTC
A workaround, maybe also a hint to the person attempting to solve this:

I ran into the same problem, but could produce a .pdf with correctly oriented letters by using the pdf output option in the print dialog instead of Export to PDF.
Comment 5 Herouth Maoz 2014-10-28 17:49:38 UTC
(In reply to Tobias Schlüter from comment #4)
> A workaround, maybe also a hint to the person attempting to solve this:
> 
> I ran into the same problem, but could produce a .pdf with correctly
> oriented letters by using the pdf output option in the print dialog instead
> of Export to PDF.

Printing to PDF
(a) Causes the loss of cross-references and table-of-content links in the document.
(b) Is good only for printing. The text is not contiguous, you can't select a sentence and copy it, for example. The selection simply doesn't follow the vertical lines, which it does in the PDF exported directly from LibreOffice.
Comment 6 Nathan Oyama 2015-12-21 05:38:05 UTC
Created attachment 121460 [details]
Actual behavior

How to crate this file

With LibreOffice 5.0.3 for Windows, 

1. Create a new Writer document

2. Go to [Format] > [Page...] > tab: [Page]
   -> Set "Text direction" to [Right-to-left (vertical)] then click [OK]

3. Type 电脑 ("a computer" in Chinese) in the document
   -> You will see these two characters appear vertically with no rotation
   -> Latin characters may rotate 90 degrees which may be an expected behavior

4. Click [Export as PDF]
   -> The Chinese characters are being rotated 90 degrees.
Comment 7 Nathan Oyama 2015-12-21 05:41:57 UTC
Created attachment 121461 [details]
expected behavior in Chinese

Taking the same steps as "actual_exportPDFchineseRotates90degrees.pdf" except the last one: 

Print the document with any third-party PDF printer. In this document I used "Bullzip" and got the expected result, i.e., the two Chinese characters "电脑" has *not* been rotated.
Comment 8 Nathan Oyama 2015-12-21 05:48:56 UTC
"Export PDF rotates Asian language characters 90 degrees if text direction is set to vertical"

IMPORTANT. This issue has been also confirmed with 

- Other Asian languages (Chinese (Simplified), in addition to Japanese)
- Other platforms (Windows and Linux)


Test Environment.

- LibreOffice 5.0.3.2 Portable for Windows: Chinese (Simplified), Japanese
- LibreOffice 5.0.4 for Linux: Japanese


How to Replicate the Issue (easy): 

- See my note dated 2015-12-21 05:38:05 UTC
- The one in the initial note by Herouth Maoz dated 2014-04-15 15:52:10 UTC sounds right.
Comment 9 madmalkav 2016-12-10 11:53:11 UTC
Can't reproduce on 5.3.0 beta1 in Windows.
Comment 10 Nathan Oyama 2016-12-10 12:39:03 UTC
I can no longer replicate the issue either.
 * LibreOffice 5.2.3.3 (US-English)
 * Windows 7 64-bit (US-English)

Maybe it's safe to assume the issue has been resolved in the recent versions.
Comment 11 Herouth Maoz 2016-12-10 13:52:29 UTC
Tested on LibreOffice 5.2.3.3, The issue has NOT been resolved on Mac OS X, on which I originally reported it.

I have no idea why it was decided it was an "all platforms" issue. It is strictly a Mac OS X bug, please test it only on Mac OS X, and please do not close based on testing on any other platform.
Comment 12 madmalkav 2016-12-10 14:31:27 UTC
It will be interesting you test 5.3.0 beta to confirm if new layout engine have any influence on the output, as users that reported the same problem on other platforms seems to no longer have this problem.
Comment 13 eisa01 2017-06-03 16:31:55 UTC
Exporting the PDF works fine for me on

Version: 5.3.0.3
Build ID: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
CPU Threads: 2; OS Version: Mac OS X 10.12.5; UI Render: default; Layout Engine: new; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 14 Yousuf Philips (jay) (retired) 2017-06-04 13:13:35 UTC
@Herouth: Can you also confirm that its fixed on Mac?
Comment 15 Herouth Maoz 2017-06-05 08:24:23 UTC
(In reply to Yousuf Philips (jay) from comment #14)
> @Herouth: Can you also confirm that its fixed on Mac?

Confirmed.