Bug 77514 - FORMATTING: CJK ruby text (furigana) in vertical mode pushes characters to the left of the base line
Summary: FORMATTING: CJK ruby text (furigana) in vertical mode pushes characters to th...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Mark Hung
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CJK
  Show dependency treegraph
 
Reported: 2014-04-16 08:24 UTC by Herouth Maoz
Modified: 2016-09-15 14:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screen shot of horizontal vs. vertical text with furigana (99.18 KB, image/png)
2014-04-16 08:24 UTC, Herouth Maoz
Details
Document used to create the screen shot. (19.08 KB, application/vnd.oasis.opendocument.text)
2014-04-16 08:25 UTC, Herouth Maoz
Details
Combinations of page style text flow, table text flow, and text frames, doc grid settings. (17.12 KB, application/vnd.oasis.opendocument.text)
2015-08-01 13:21 UTC, Mark Hung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Herouth Maoz 2014-04-16 08:24:32 UTC
Created attachment 97455 [details]
Screen shot of horizontal vs. vertical text with furigana

When using "Asian phonetic guide" to add furigana to Japanese text, if the text is vertical (either through page text direction or a frame's text direction set to "right-to-left (vertical)"), the words that have furigana are pushed to the left of the base line.

* Create a text document.
* Copy-paste some long Japanese text that will wrap to more than two lines.
* Select a word in the middle line and use "Asian phonetic guide" to add furigana(ruby) to it.

Result: the word gets pushed to the left. The space between the lines is increased both on its left and on its right.
Expected result: the word stays aligned to the other text. Line spacing on its left should not change, line spacing on its right should adjust to accomodate the furigana, as it does in horizontal text.
Comment 1 Herouth Maoz 2014-04-16 08:25:54 UTC
Created attachment 97456 [details]
Document used to create the screen shot.
Comment 2 Yousuf Philips (jay) (retired) 2014-07-11 10:38:48 UTC
Dear Herouth,

Thank you for submitting the bug. I can confirm that the bug is available in 3.3.0, 4.2.5 and master.
Comment 3 Mark Hung 2015-08-01 13:21:57 UTC
Created attachment 117577 [details]
Combinations of page style text flow, table text flow, and text frames, doc grid settings.

I'm working on this issue and have created a test cases to show the affected function of the defect. My test cases is combinations of a) page style with gird or without grid. b) page style text flow set to LTR or RTL. c) text frames with different text flows. d) tables with different text flows.


In summary ( in LO4.4.4.3):
a) Alignment whose text flow is LTR (horizontal ) are all correct.
b) Alignment of text where text flow is RTL in text frames are all incorrect.
c) Alignment of text where text flow is RTL in a page with document grid disabled are incorrect.
Comment 4 Commit Notification 2015-08-25 11:58:37 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "master":

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

Fix tdf#77514 CJK ruby text in RTL( vertical ) base line issue.

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 5 Yousuf Philips (jay) (retired) 2015-08-25 17:07:31 UTC
Thanks for the fix. I've also cherry picked this for 5.0 and 4.4.
Comment 6 Yousuf Philips (jay) (retired) 2015-08-25 17:08:46 UTC
Cherry-picking it for 4.4 didnt work, so is it possible for you to send in a patch for 4.4 Mark?
Comment 7 Commit Notification 2015-08-25 20:07:17 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=f0a149fe1c3224cef17f15e574b0a818923b57f6&h=libreoffice-5-0

Fix tdf#77514 CJK ruby text in RTL( vertical ) base line issue.

It will be available in 5.0.2.

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 8 Mark Hung 2015-12-04 06:01:47 UTC
I'm reverting the change. 

Note the state should be set to "Not a bug". Users can set paragraph text-to-text setting in alignment tab to "bottom" or "baseline" instead of "automatic", hence getting the expected result.
Comment 9 Christian Lohmaier 2015-12-15 14:39:52 UTC
reopen, the fix caused a regression (bug#96125) and was reverted.
Comment 10 Mark Hung 2016-09-15 14:41:13 UTC
In RTL vertical mode, the baseline is at the left side of the line. Default automatic text-to-text alignment aligns to the center. Howeverthe problem can be fixed in following way:

Right Click on the paragraph -> Pargraph -> Click "Alignment" tab -> 
select "Baseline" or "Bottom" from drop down list for Text-to-text Alignment.

Set to "Resolved" and "NotAbug"