Bug 103970 - Wrong glyph orientation for OTF formated CJK font on vertical layout
Summary: Wrong glyph orientation for OTF formated CJK font on vertical layout
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha1+
Hardware: All Windows (All)
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Vertical-Text
  Show dependency treegraph
 
Reported: 2016-11-17 09:11 UTC by Volga
Modified: 2017-03-28 19:44 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file (10.52 KB, application/vnd.oasis.opendocument.text)
2016-11-17 09:16 UTC, Volga
Details
My screenshot (35.98 KB, image/png)
2016-11-17 09:18 UTC, Volga
Details
Screenshot, no problem (67.62 KB, image/png)
2016-11-20 16:48 UTC, ⁨خالد حسني⁩
Details
My screenshot #2 (33.18 KB, image/png)
2016-11-22 07:46 UTC, Volga
Details
My screenshot #3 (33.08 KB, image/png)
2016-11-23 15:07 UTC, Volga
Details
Screenshot from LODev on Windows 7 (131.92 KB, image/png)
2016-11-29 15:21 UTC, Volga
Details
Screenshot with OpenGL enabled (104.48 KB, image/png)
2016-11-30 03:43 UTC, Volga
Details
Screenshot from LibO 5.3.0.1 (230.72 KB, image/png)
2017-01-09 03:55 UTC, Volga
Details
Screenshot from LibO 5.3.0.3 (131.42 KB, image/png)
2017-02-19 00:26 UTC, Volga
Details
Screenshot from LibO 5.3.0.3 (2) (117.63 KB, image/png)
2017-02-20 13:07 UTC, Volga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2016-11-17 09:11:11 UTC
Description:
Recent fixes on LODev 5.3 cause wrong glyph orientation for OTF formated CJK fonts within vertical text

Steps to Reproduce:
1. Insert frame interactivety and set direction as RTL (vertical) 
2. Insert texts (for example, Thousand Character Classic https://en.wikipedia.org/wiki/Thousand_Character_Classic )

Actual Results:  
When I use TrutType font, they are upright, when I using OpenType CFF font, they looks rotated.

Expected Results:
The glyph orientation on vertical layout should be applied even if using different font formats.


Reproducible: Always

User Profile Reset: No

Additional Info:
Version: 5.3.0.0.alpha1+
Build ID: c03c77ef4f46b81cd000ea26c4ef154044322535
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-11-17_00:29:08
Locale: zh-CN (zh_CN); Calc: group



User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0
Comment 1 Volga 2016-11-17 09:16:52 UTC
Created attachment 128802 [details]
Test file

You can get the font from following resources:

BabelStone Han: http://www.babelstone.co.uk/Fonts/Han.html
Source Han Sans: https://github.com/adobe-fonts/source-han-sans/
(I used Source Han Sans SC)
Comment 2 Volga 2016-11-17 09:18:25 UTC
Created attachment 128803 [details]
My screenshot
Comment 3 ⁨خالد حسني⁩ 2016-11-20 16:48:52 UTC
Created attachment 128889 [details]
Screenshot, no problem

I can’t reproduce this. If you have OpenGL enabled, disable it and test again. If the issue persists, please provide a direct link to the exact version of the font you are using.
Comment 4 Volga 2016-11-21 03:22:47 UTC
(In reply to Khaled Hosny from comment #3)
> Created attachment 128889 [details]
> Screenshot, no problem
> 
> I can’t reproduce this. If you have OpenGL enabled, disable it and test
> again. If the issue persists, please provide a direct link to the exact
> version of the font you are using.

I have enabled “Use OpenGL for all rendering”, but I have not enable “Ignore OpenGL blacklist”, then I got the notice “GL is currently disabled”. Now I completely disabled OpenGL, but the problem looks the same.

You can get fonts from following resources:
http://babelstone.co.uk/Fonts/5521/BabelStoneHan.zip
https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SimplifiedChinese/SourceHanSansSC-Regular.otf
Comment 5 ⁨خالد حسني⁩ 2016-11-21 18:00:18 UTC
(In reply to Volga from comment #4)
> https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/
> SimplifiedChinese/SourceHanSansSC-Regular.otf

I still can’t reproduce the issue using this font (note I need to change the font in the document because the Chinse font name does not work for me).
Comment 6 Volga 2016-11-22 01:52:22 UTC
Then I out of idea, maybe you can try to get more fonts from here if you want more tests:
https://code.google.com/archive/p/kingfont/downloads
https://code.google.com/archive/p/ifont/downloads
Comment 7 Volga 2016-11-22 07:46:47 UTC
Created attachment 128932 [details]
My screenshot  #2

OK, they works to me now. But to my surprise, when I use Source Han Sans, the line height is extremely height.

Version: 5.3.0.0.alpha1+
Build ID: 02ec51c7e0bf9320b32ec73233ecaaf160448776
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-11-20_23:12:18
Locale: zh-CN (zh_CN); Calc: group
Comment 8 ⁨خالد حسني⁩ 2016-11-22 15:36:45 UTC
The line height issue is tracked in bug 55469.
Comment 9 Volga 2016-11-23 15:07:01 UTC
Created attachment 128961 [details]
My screenshot #3

After you fixed that, the problem appearing to me again.

Version: 5.3.0.0.alpha1+
Build ID: f965a629fba10ecba7bad938a0c1c9c3db1e510d
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-11-23_00:13:10
Locale: zh-CN (zh_CN); Calc: group
Comment 10 Volga 2016-11-25 03:20:45 UTC
This problem is still appearing to me even if I get 5.3 beta1.

Version: 5.3.0.0.beta1
Build ID: 690f553ecb3efd19143acbf01f3af4e289e94536
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; Layout Engine: new; 
Locale: zh-CN (zh_CN); Calc: group
Comment 11 ⁨خالد حسني⁩ 2016-11-25 07:35:59 UTC
(In reply to Volga from comment #10)
> This problem is still appearing to me even if I get 5.3 beta1.
> 
> Version: 5.3.0.0.beta1
> Build ID: 690f553ecb3efd19143acbf01f3af4e289e94536
> CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; Layout Engine:
> new; 
> Locale: zh-CN (zh_CN); Calc: group

Can anyone else confirm this?
Comment 12 Buovjaga 2016-11-25 08:35:17 UTC
(In reply to Volga from comment #1)
> Source Han Sans: https://github.com/adobe-fonts/source-han-sans/
> (I used Source Han Sans SC)

Is there any way I can get this without the 1.6 gigabyte download?
Comment 13 Volga 2016-11-25 15:27:06 UTC
(In reply to Buovjaga from comment #12)
> (In reply to Volga from comment #1)
> > Source Han Sans: https://github.com/adobe-fonts/source-han-sans/
> > (I used Source Han Sans SC)
> 
> Is there any way I can get this without the 1.6 gigabyte download?

Try this branch
https://github.com/adobe-fonts/source-han-sans/tree/release?files=1
Or download from CodePlex.
http://sourcehansansmirror.codeplex.com/
Comment 14 Volga 2016-11-27 14:29:31 UTC
(In reply to Khaled Hosny from comment #5)
> (In reply to Volga from comment #4)
> > https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/
> > SimplifiedChinese/SourceHanSansSC-Regular.otf
> 
> I still can’t reproduce the issue using this font (note I need to change the
> font in the document because the Chinse font name does not work for me).

Maybe you can get a range of VMs from Microsoft to run LibO if you want to reproduce.
https://dev.windows.com/en-us/microsoft-edge/tools/vms/
Comment 15 ⁨خالد حسني⁩ 2016-11-27 14:36:06 UTC
(In reply to Volga from comment #14)
> (In reply to Khaled Hosny from comment #5)
> > (In reply to Volga from comment #4)
> > > https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/
> > > SimplifiedChinese/SourceHanSansSC-Regular.otf
> > 
> > I still can’t reproduce the issue using this font (note I need to change the
> > font in the document because the Chinse font name does not work for me).
> 
> Maybe you can get a range of VMs from Microsoft to run LibO if you want to
> reproduce.
> https://dev.windows.com/en-us/microsoft-edge/tools/vms/

I do, and I can’t reproduce this.
Comment 16 Volga 2016-11-27 16:55:54 UTC
So can anyone else confirm this?
Comment 17 V Stuart Foote 2016-11-27 17:40:44 UTC
Likewise confirming this is RESOLVED WORKSFORME

On Windows 10 Pro 64-bit (1607) en-US with
Version: 5.3.0.0.beta1 (x64)
Build ID: 690f553ecb3efd19143acbf01f3af4e289e94536
CPU Threads: 8; OS Version: Windows 6.19; UI Render: GL; Layout Engine: new; 
Locale: en-US (en_US); Calc: CL

also with default GDI+ rendering and the new HarfBuzz layout engine.

With attachment 128802 [details] sample document the font "思源黑体" (Sīyuán hēitǐ) is not an installed font, and receives an unidentifed fall back substitution, but I'd installed BableStone Han.

Glyps from both paragraphs rotated CJK--fall-back and BableStone Han--are correctly rotated and aligned.

For this, I've downloaded and installed the .otf font "Source Han Sans SC" [1] and used that to replace the 思源黑体 in the paragraph.

Glyphs for it are also correctly rotated in vertical layout--confirming as resolved WFM.

=-ref-=
[1] https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SimplifiedChinese/SourceHanSansSC-Regular.otf
Comment 18 Volga 2016-11-28 04:51:57 UTC
So what happened if you turn off OpenGL?
Comment 19 Volga 2016-11-29 15:21:37 UTC
Created attachment 129125 [details]
Screenshot from LODev on Windows 7

I have a virtual machine installed Windows 7, then I share the installation package, document and fonts to there when I run this VM. To my surprise, Source Han Sans works proper on LODev Writer, that’s odd.
Comment 20 Volga 2016-11-30 03:43:20 UTC
Created attachment 129146 [details]
Screenshot with OpenGL enabled

I have enabled OpenGL and ignored OGL blacklist, it works for me, but glyphs are clipped.
Comment 21 Volga 2016-12-01 16:34:55 UTC
(In reply to Volga from comment #18)
> So what happened if you turn off OpenGL?

I understand you, but I still have no idea why this bug is still affect me when I use GDI+ rendering.
Comment 22 Volga 2017-01-09 03:55:02 UTC
Created attachment 130271 [details]
Screenshot from LibO 5.3.0.1

This problem still affect me even if I get newer builds on Windows 10 build 14393, downloaded from http://dev-builds.libreoffice.org/pre-releases/win/x86_64/
Comment 23 Volga 2017-01-24 09:08:29 UTC
On LibO 5.3.0.2 they works to me on Win 10, thanks to everyone.

Version: 5.3.0.2 (x64)
Build ID: 5ad7b2889021c491af62f7930a4b1cb631392f16
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; 布局引擎:新; 
Locale: zh-CN (zh_CN); Calc: group
Comment 24 Buovjaga 2017-01-24 09:53:31 UTC
Cool, but let's keep as WFM because we still don't know the fix.
Comment 25 Volga 2017-02-19 00:26:52 UTC
Created attachment 131332 [details]
Screenshot from LibO 5.3.0.3

Eh, this problem appearing to me again on LibO 5.3, tested on Win10 version 14393.

Version: 5.3.0.3 (x64)
Build ID: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: zh-CN (zh_CN); Calc: group
Comment 26 Volga 2017-02-20 13:07:15 UTC
Created attachment 131358 [details]
Screenshot from LibO 5.3.0.3 (2)

Tested again after OpenGL enabled, the glyph origin works with me for both OTF and TTF fonts. It seems to me that our GDI rendering engine failed in this case.

Version: 5.3.0.3 (x64)
Build ID: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL; Layout Engine: new; 
Locale: zh-CN (zh_CN); Calc: group
Comment 27 Volga 2017-03-14 07:46:24 UTC
LibO 5.3.1.2 is well performanced for such fonts.

Version: 5.3.1.2 (x64)
Build ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: zh-CN (zh_CN); Calc: group
Comment 28 Xisco Faulí 2017-03-14 08:34:39 UTC
(In reply to Volga from comment #27)
> LibO 5.3.1.2 is well performanced for such fonts.
> 
> Version: 5.3.1.2 (x64)
> Build ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2
> CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine:
> new; 
> Locale: zh-CN (zh_CN); Calc: group

Then let's close it as RESOLVED WORKSFORME.
Thanks for testing it.
Comment 29 Volga 2017-03-18 06:32:45 UTC
I have checked again, when I open my computer at the next time, open LibreOffice, the problem appearing again. 

Version: 5.3.1.2 (x64)
Build ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: zh-CN (zh_CN); Calc: group
Comment 30 ⁨خالد حسني⁩ 2017-03-18 17:52:39 UTC
Since nobody else is able to reproduce this issue, I’m closing as invalid. Please don’t reopen unless someone other than Volga can reproduce it. Thanks.
Comment 31 Volga 2017-03-28 10:07:20 UTC
After I installed LO 5.3.2.0.0, this problem disappeared to me.