Issue 89825 - Numbers / digits following RTL should be treated as CTL
Summary: Numbers / digits following RTL should be treated as CTL
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.4.0
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: stefan.baltzer
QA Contact: issues@sw
: 34543 83117 (view as issue list)
Depends on:
Reported: 2008-05-23 08:13 UTC by hennerdrewes
Modified: 2013-08-07 14:43 UTC (History)
5 users (show)

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

Sample document (7.50 KB, application/vnd.oasis.opendocument.text)
2008-05-23 08:18 UTC, hennerdrewes
no flags Details
Sample screenshot (1.95 KB, image/png)
2008-05-23 08:21 UTC, hennerdrewes
no flags Details
patch for writer (3.48 KB, patch)
2008-07-04 12:48 UTC, hennerdrewes
no flags Details | Diff
Screenshot after patch (2.85 KB, image/png)
2008-07-04 12:49 UTC, hennerdrewes
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description hennerdrewes 2008-05-23 08:13:36 UTC
Numbers written in e.g. Hebrew text will be classified as LATIN. When having
different fonts for Latin and CTL (e.g. Times New Roman and David, which is a
very common combination), the visual appearance of the numbers does not fit well
into the surrounding text.

This problem has been mentioned in several issues, but generally the main cause
has not been clarified to a satisfying extent. See e.g. issue 34543 and issue
19012. In my opinion a similar solution to that of issue 16354 (on punctuation
characters) should be also applied to digits following CTL text.

Attaching samples...
Comment 1 hennerdrewes 2008-05-23 08:18:28 UTC
Created attachment 53867 [details]
Sample document
Comment 2 hennerdrewes 2008-05-23 08:21:40 UTC
Created attachment 53868 [details]
Sample screenshot
Comment 3 hennerdrewes 2008-05-23 08:29:59 UTC
The sample document has Times New Roman as Western font, and David as CTL font.
The font size is set differently on purpose to emphasize the issue. 

Please also note the difference in punctuation characters "." between the fonts.
The dot inside the numbers is Times New Roman, while the others are David. This
strange mixing of punctuation characters can be also observed in the sample
documents of issue 34543 in the paragraph numbering. 

Also attached screenshot (in case David font is not installed on the system,
this might be useful)
Comment 4 michael.ruess 2008-05-23 10:44:52 UTC
Reassigned to SBA.
Comment 5 nadavkav 2008-05-31 14:12:28 UTC
this is an issue indeed ! i can confirm it on OO 2.3 (fedora 8) and OO 2.4
(Debian sid).

it is quite a wide and complex issue since there are so many fonts with
different matrix sizes for width and height. not to mention the font
substitution that occurs when we do not have a font on our machine.

personally, i expect the font glyphs to be in the right height for CTL + numbers
and Western + numbers in the same font that i choose to use.

i do not want OO to switch font for Western when i start to type numbers after
some CTL letters that i already typed in.

and again i would like to mention that some glyph numbers in CTL fonts are
bigger then the hebrew letters and this is visually an issue for that font
alone. (this occur in Western fonts too)

Comment 6 hennerdrewes 2008-07-04 12:48:19 UTC
Created attachment 54938 [details]
patch for writer
Comment 7 hennerdrewes 2008-07-04 12:49:43 UTC
Created attachment 54939 [details]
Screenshot after patch
Comment 8 hennerdrewes 2008-07-04 12:50:41 UTC
changed issue type to patch
Comment 9 hennerdrewes 2008-07-04 12:57:46 UTC
@fme: Could you have a look at the patch?

The patch also sets the script type of LTR runs to CTL under the following
- The LTR run does not contain any strong LTR characters (so we can assume that
numbers are present, otherwise it wouldn't be LTR)
- it follows an RTL run, or the paragraph direction is RTL

Comment 10 frank.meies 2008-07-04 14:00:31 UTC
Thank you for your patch. I'll have a look.
Comment 11 frank.meies 2008-07-10 06:30:53 UTC
fme->hennerdrewes: Thank you for your patch. I'll have a look.
Comment 12 frank.meies 2008-09-18 12:03:51 UTC
@hennerdrewes: I suggest to change the condition in porlay.cxx to this:

// Change script type under these conditions:
if ( nCurrDirType % 2 == UBIDI_RTL  || // text in RTL run
    ( nCurrDirType > UBIDI_LTR &&
      !lcl_HasStrongLTR( rTxt, nStart, nEnd ) ) ) // non-strong text in embedded
LTR run

What do you think?

Comment 13 hennerdrewes 2008-09-18 13:45:27 UTC
@fme: yes, looks good to me
Comment 14 frank.meies 2008-09-29 13:29:37 UTC
Comment 15 hennerdrewes 2008-09-30 20:06:49 UTC
@fme: the original patch also contained a change to porfld.cxx, which I didn't
see in cws swarab02. Is this on purpose?
Comment 16 frank.meies 2008-09-30 22:13:22 UTC
@hennerdrewes: Thanks for pointing me to this, I'll add the missing code. Btw: I
moved all fixes from swarab02 to cws kashidafix. Seems to be reasonable to have
them together with the kashida fix.
Comment 17 hennerdrewes 2008-10-01 07:56:20 UTC
@fme: OK, good. Already wanted to ask you about this...

I'll adapt my last kashidafix patch to the changes.
Comment 18 frank.meies 2008-10-01 08:25:22 UTC
@hennerdrewes: I already made some changes and committed them (IsArabicLanguage
-> IsArabicText).
Comment 19 alan 2008-11-02 17:19:09 UTC
See Issue 83117, which addressed the same problem.
Comment 20 alan 2008-11-03 13:41:55 UTC
*** Issue 34543 has been marked as a duplicate of this issue. ***
Comment 21 frank.meies 2008-11-13 07:30:32 UTC
*** Issue 83117 has been marked as a duplicate of this issue. ***
Comment 22 frank.meies 2008-11-27 10:45:12 UTC
Ready for QA.
Comment 23 stefan.baltzer 2008-12-04 10:21:46 UTC
Verified in CWS kashidafix
Comment 24 thorsten.ziehm 2009-07-20 14:52:11 UTC
This issue is closed automatically and wasn't rechecked in a current version of
OOo. The fixed issue should be integrated in OOo since more than half a year. If
you think this issue isn't fixed in a current version (OOo 3.1), please reopen
it and change the field 'Target Milestone' accordingly.

If you want to download a current version of OOo =>
If you want to know more about the handling of fixed/verified issues =>
Comment 25 thorsten.ziehm 2009-07-20 15:35:46 UTC
Sorry this issue was wrongly closed. This issue will be reopened automatically.
And will be set after that back to fixed/verified.
Comment 26 thorsten.ziehm 2009-07-20 15:40:09 UTC
Set to state 'fixed'.
Comment 27 thorsten.ziehm 2009-07-20 15:44:22 UTC
Set back to state 'verified/fixed'.

Again. Sorry for the mass of mails.
Comment 28 thorsten.ziehm 2010-02-22 14:47:02 UTC
This issue is closed automatically. It should be fixed in a version with is
available for longer than half a year (OOo 3.1). If you think this issue isn't
fixed in the current version (OOo 3.2) please reopen it. But then please pay
attention about the field 'target milestone'.
The closure was approved by the Release Status Meeting at 22nd of February 2010
and it is based on the issue handling guideline for fixed/verified issues  :