Bug 40335 - Using Right-to-left (vertical) for text, the characters overlap each other
Summary: Using Right-to-left (vertical) for text, the characters overlap each other
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.2 release
Hardware: All Linux (All)
: medium critical
Assignee: Mark Hung
URL:
Whiteboard: target:5.1.0 target:5.0.3
Keywords:
Depends on:
Blocks: CJK
  Show dependency treegraph
 
Reported: 2011-08-23 23:36 UTC by Cheng-Chia Tseng
Modified: 2016-09-16 16:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
See the characters overlapping each other (97.08 KB, image/png)
2011-08-23 23:36 UTC, Cheng-Chia Tseng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cheng-Chia Tseng 2011-08-23 23:36:56 UTC
Created attachment 50517 [details]
See the characters overlapping each other

It only happens on Linux systems.

How to reproduce?
1. Prepare CJK fonts first, and install them.
2. Open Writer.Choose "Format" > "Pages", and switch to  "Page" tab.
3. Change "Text orientation" into "Right-to-left (vertical)"
4. Input or copy and paste some Chinese characters. Example, "中文輸入時中文字之間距過小,互相重疊。"

The problem is that the cursor is not actually at the bottom of characters. While inputting Chinese characters, the cursor is about at half height of the characters.

Thus, the head of next character overlaps the bottom of previous character.

This is very series problem for CJK users, because those characters cannot be recognize well.
Comment 1 Cheng-Chia Tseng 2011-08-23 23:41:59 UTC
You can get a free and open Chinese font from below to test with: 
http://code.google.com/p/cwtex-q-fonts/source/browse/trunk/ttf/cwTeXQHei-Bold.ttf
Comment 2 Cheng-Chia Tseng 2011-08-24 00:06:17 UTC
(In reply to comment #1)
> You can get a free and open Chinese font from below to test with: 
> http://code.google.com/p/cwtex-q-fonts/source/browse/trunk/ttf/cwTeXQHei-Bold.ttf

I am using cwTeXHeiBold instead of cxTeXQHei-Bold. The site of cwTexHeiBold cannot be connected now [1], so I provide cwTeXQHei-Bold (edited one) as link.

However, cwTeXQHei-Bold has more spacing when vertical, so it seems to be normal.

You can download AR PL UMing [2] or WQY MicroHei [3] to see the difference between those two fonts. AR PL UMing has less spacing when vertical, and it will be overlapping like cwTexHeiBold.

1. http://cle.linux.org.tw/fonts/cwttf/baseline/cwheib.ttf
2. http://www.freedesktop.org/wiki/Software/CJKUnifonts/Download
3. http://sourceforge.net/projects/wqy/files/wqy-microhei/0.2.0-beta/
Comment 3 Björn Michaelsen 2011-12-23 12:35:10 UTC Comment hidden (obsolete)
Comment 4 Cheng-Chia Tseng 2012-01-18 10:47:57 UTC
The bug is still there.

Is it related to LibreOffice? Or may it be related to freetype or something else handling fonts rendering?
Comment 5 sasha.libreoffice 2012-02-02 02:01:00 UTC
It is reproducible with any font or only with some?
Comment 6 Cheng-Chia Tseng 2012-02-02 04:44:23 UTC
Most of the fonts which contain Han characters (used in Chinese, Japanese, Korean) will cause that problem (reproducible).
Comment 7 sasha.libreoffice 2012-02-02 05:39:24 UTC
@ Caolan
Please, take look at this
Comment 8 Cheng-Chia Tseng 2013-07-29 16:40:38 UTC
The cursor is not located at the right bottom of each character. 

Most of the time, the cursor is on the middle or the 2/3 of one character, it makes confusion and make it hard to select characters and manipulate.
Comment 9 sasha.libreoffice 2013-07-30 07:41:34 UTC
Thanks for additional testing.
I have also reproduced this bug on Fedora (RFR) 64 bit using initial description.
(4.1.0)

Sorry, but "version" is most old version of LO where bug appears. Not a current version. If bug disappears we just closing bugreport.

Changing version back to 3.4.2
Comment 10 Cheng-Chia Tseng 2013-07-30 16:09:45 UTC
OK, I got that. :P Thanks for your info.
Comment 11 Cheng-Chia Tseng 2015-01-07 14:33:40 UTC
I tested with LibreOffice 4.3.5.2 on fedora 21 today.

The character-overlapping problem is much improved, but the cursor is not still right at the bottom of each character. The cursor is still higher than it should actually be.
Comment 12 Mark Hung 2015-08-15 14:54:55 UTC
This issue has the same root cause as tdf#40091, where character width instead of its height is used to advance the position in RTL vertical mode.
Comment 13 Commit Notification 2015-08-16 06:43:36 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "master":

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

Fix tdf#40091 and tdf#40335 text layout issues.

It will be available in 5.1.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 14 Commit Notification 2015-09-26 11:48:03 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a4532151e3ca83488bc8fd255cc64971421b4517&h=libreoffice-5-0

Fix tdf#40091 and tdf#40335 text layout issues.

It will be available in 5.0.3.

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 Cheng-Chia Tseng 2016-09-16 16:33:36 UTC
confirmed fixed in 5.1.5.