Issue 53373 - Align "Justified" in Draw text box does not work very well for CJK text
Summary: Align "Justified" in Draw text box does not work very well for CJK text
Status: ACCEPTED
Alias: None
Product: Writer
Classification: Application
Component: formatting (show other issues)
Version: OOo 1.0.0
Hardware: All All
: P4 Trivial with 6 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
: 58813 69008 (view as issue list)
Depends on:
Blocks:
 
Reported: 2005-08-16 11:29 UTC by naoyuki
Modified: 2013-08-07 14:44 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Japanese text sample for TextBox justification (6.98 KB, application/vnd.oasis.opendocument.text)
2005-08-16 11:31 UTC, naoyuki
no flags Details
Same text string in Writer text, Writer Text frame and Draw text box (9.38 KB, application/vnd.sun.xml.writer)
2005-08-18 13:20 UTC, stefan.baltzer
no flags Details
PDF export of it... (24.13 KB, application/pdf)
2005-08-18 13:21 UTC, stefan.baltzer
no flags Details
proof of fix (76.64 KB, image/png)
2010-01-12 21:45 UTC, kyoshida
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description naoyuki 2005-08-16 11:29:36 UTC
How to reproduce
1. open attached file (ja_justify.odt)
2. double click text
3. click "Align Left" or "Justified" 
"Justfied" does not align right side of Japanese text well.
This is reported as Impress bug from user, but general for all of TextBox.
Comment 1 naoyuki 2005-08-16 11:31:15 UTC
Created attachment 28803 [details]
Japanese text sample for TextBox justification
Comment 2 michael.ruess 2005-08-16 11:55:54 UTC
Reassigned to SBA.
Comment 3 lohmaier 2005-08-17 20:15:36 UTC
Please explain what you mean with "not well". To me it looks fine. Please
provide a screenshot with more explanation. Please mention the real version of
OOo you used. 
Comment 4 stefan.baltzer 2005-08-18 13:16:17 UTC
SBA: (1) It depends on the font....  The font that Naoyuki used is a
proportional font. ("HG-P MinchoL Sun", only that "Mincho" is in Japanese
Kanji)) - If a system has to replace this one with a non-proportional CJK font
(i.e. Arial Unicode MS), the problem is not visibe.
(2) The document has a Draw Text Frame that shows the problem. within these,
other algorithms do text formatting than in Writer Text frames or in a Writer
Text document. I will attach a Writer document with all three and for those
who'd like to see the problem, the correspondent PFD export, too.

In total, this is not exactly a Writer problem (although FME will have to deal
with it :-) and from the "Writer point of view", this is a Prio4 proplem. 
Reassigned to FME.
  
Comment 5 stefan.baltzer 2005-08-18 13:17:50 UTC
SBA: I removed the keyword "needmoreinfo" because I could reproduce it and
tracked it down with FME.
Comment 6 stefan.baltzer 2005-08-18 13:20:25 UTC
Created attachment 28882 [details]
Same text string in Writer text, Writer Text frame and Draw text box
Comment 7 stefan.baltzer 2005-08-18 13:21:31 UTC
Created attachment 28883 [details]
PDF export of it...
Comment 8 stefan.baltzer 2005-08-18 13:23:17 UTC
SBA: Adjusted Summary (Problem exists in Draw Text box only)
Comment 9 michael.ruess 2006-08-30 10:48:12 UTC
*** Issue 69008 has been marked as a duplicate of this issue. ***
Comment 10 tora3 2008-06-19 03:38:39 UTC
Any suggestion to the issue 58813 ?

A body text of Writer is capable of handling with align justified for Asian 
characters as well as Western letters. 

A text box on the Drawing tool bar currently seems not to able to take care of 
Asian characters in a desired way. Justification in a text box using a space 
u0020 is working well, but justification for Asian characters seems not to work 
at all. 

For Asian characters, align justified could be implemented by adding a small 
padding between each Asian character to make the whole length of the text fit 
to the margin. While for Western letters, align justified is implemented by 
adjusting the width of space letter to make the whole length of the text fit 
to the margin. 

In the issue 58813, forbidden character is mentioned, but it is not necessary. 
Using a proportional font such as "MS PMincho," this phenomenon easily can be 
reproduced. 
Comment 11 zhangweiwu 2008-06-19 04:05:55 UTC
Hi. One suggestions:

Please add the word "CJK", "Chinese", "Korean", "Unicode", "font" to this
issue's description or subject, because they seems to be the keyword the bug
reporters use to search before they submit a duplicated bug.

Just curious, is there a cross-platform layout engine that can be plugged in to
any word processing / layout application to do the things like text
justification, calculating space between ideograph? As far as I know this is a
problem that a lot other software meets (OOO, LaTex, Scribus, Abiword, Kword,
Ted, a2ps, firefox, thunderbird, etc etc) and does it make sense to use a
cross-platform library for this?

e.g. some text layout issue are very hard to solve (proper vertical
top-to-bottom right-to-left layout I used to use in Outlook Express emails when
I write email with history scholars). MS seems to be able to solve this problem
on a wider scale, e.g. I can make webpages in top-bottom right-left layout with
IE and use this layout for writing emails, this is an impossible in all OSS
email/browser software I used. Did MS use some cross-product library for their
own use?
Comment 12 frank.meies 2008-06-19 07:32:44 UTC
fme->tl: EditEngine issue.
Comment 13 kyoshida 2010-01-12 20:28:38 UTC
*** Issue 58813 has been marked as a duplicate of this issue. ***
Comment 14 kyoshida 2010-01-12 20:35:08 UTC
It would be nice to either use an external layout engine to do the justification
or make one from OOo's code.  But right now, OOo does its own text layout
processing.  To make matters worse, Writer's text layout code and
Calc/Draw/Impress's text layout are totally separate code, so there is a fair
amount of duplication going on there.

Anyway, I found the root cause of this while investigating for Issue 107470.  I
can take care of this.
Comment 15 kyoshida 2010-01-12 21:35:37 UTC
started.
Comment 16 kyoshida 2010-01-12 21:45:57 UTC
Created attachment 67162 [details]
proof of fix
Comment 17 kyoshida 2010-01-12 22:15:12 UTC
>is there a cross-platform layout engine that can be plugged in to
any word processing / layout application to do the things like text
justification, calculating space between ideograph?

The ICU library provides a generic text layout engine that is cross-platform:

  http://userguide.icu-project.org/layoutengine

However, from the description in the User Guide, it seems to work only in a
single font, single script case.  So, even if we were try to use that library,
it would only work with unformatted string rendering only.
Comment 18 adajun 2010-03-08 08:06:26 UTC
"proof of fix" means you already fixed?
When we can use fixed version? 
Comment 19 kyoshida 2010-03-08 14:20:45 UTC
This will be fixed in in the koheiasiantextalign cws, which is targeted for 3.4
inclusion.  The feature freeze for 3.3 is almost around the corner which is the
reason for setting target on 3.4.

If you would like to "preview" this fix, go-oo 3.2.1 will include it in case you
are open to trying a downstream version of OOo.
Comment 20 Rob Weir 2013-07-30 02:39:33 UTC
Reset assignee on issues not touched by assignee in more than 1000 days.