Bug 339090 - Bidi: Consistent support of Arabic-Indic digits and Numeric contextual behavior in Eclipse projects
Summary: Bidi: Consistent support of Arabic-Indic digits and Numeric contextual behavi...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks: 274567
  Show dependency tree
 
Reported: 2011-03-07 09:36 EST by Dina Sayed CLA
Modified: 2019-11-14 03:41 EST (History)
4 users (show)

See Also:


Attachments
Proposed patch to fix contextual numeral shaping (9.71 KB, patch)
2011-03-27 09:27 EDT, Dina Sayed CLA
no flags Details | Diff
Proposed patch (4.31 KB, patch)
2011-03-31 11:49 EDT, Dina Sayed CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dina Sayed CLA 2011-03-07 09:36:45 EST
Build Identifier: 

Numeric contextual behavior requires the digits following Latin text to be represented in Arabic-Western digits while those following Arabic text to be represented in Arabic-Indic representation. 

Digits representation in IES has to reflect user preferences for Digit substitution. Also, this support needs to be consistent across all IES projects.

This bug will be a place holder for Digits shaping bugs.


Reproducible: Always
Comment 1 Dani Megert CLA 2011-03-16 06:10:31 EDT
Dina, shouldn't the version be '3.7'?
Comment 3 Felipe Heidrich CLA 2011-03-28 10:09:40 EDT
is the intent of this problem report to track the changes needed in SWT to implement the requested feature ?

Please, clean the patch:
- it includes changes for othr projects (draw2d etc)
- it includes the changes I released for surrogates last week
- it has a funny method in Resource:

public int getSystemDigitSubistitution(){ 
   int digitSub=-1; 
   return digitSub; 
}

it has one method that seems to do something in TextLayout:
/* 
 * Returns the following  
 * 0 when Contextual Digit Substitution is selected  
 * 1 when None Digit Substitution is selected  
 * 2 when National Digit Substitution is selected 
 */ 
public int getSystemDigitSubistitution(){ 
 	 
	SCRIPT_DIGITSUBSTITUTE scriptDigitSubistitue= new SCRIPT_DIGITSUBSTITUTE(); 
 	OS.ScriptRecordDigitSubstitution(OS.LOCALE_USER_DEFAULT,scriptDigitSubistitue); 
 	return scriptDigitSubistitue.DigitSubstitute; 
} 

(I suppose this is the only method you really need...)

- no need to add your name to the copyright (you work for IBM)
Comment 4 Felipe Heidrich CLA 2011-03-28 11:21:50 EDT
(In reply to comment #3)
> it has one method that seems to do something in TextLayout:
> /* 
>  * Returns the following  
>  * 0 when Contextual Digit Substitution is selected  
>  * 1 when None Digit Substitution is selected  
>  * 2 when National Digit Substitution is selected 
>  */ 
> public int getSystemDigitSubistitution(){ 

Is this a Windows only concept ? What about Mac and Linux, did you search for similar support on Mac and Linux ? What is default behaviour for Mac and Linux for digit substitution (in another word, what is the correct value that getSystemDigitSubistitution() should return on mac and linux?)

---

All our getSystemSomething() are in Display, I believe that Display is the right place to add this new getSystemDigitSubistitution() method.

---

Returing magic numbers in the API is usualy a bad practice, we sould add constants IMO.

---

In Uniscribe (win32), I saw 4 possible return values:
SCRIPT_DIGITSUBSTITUTE_CONTEXT
SCRIPT_DIGITSUBSTITUTE_NATIONAL
SCRIPT_DIGITSUBSTITUTE_NONE
SCRIPT_DIGITSUBSTITUTE_TRADITIONAL

Your JavaDoc only describes three, why is that ?
Comment 5 Dina Sayed CLA 2011-03-31 11:49:17 EDT
(In reply to comment #3)
> is the intent of this problem report to track the changes needed in SWT to
> implement the requested feature ?
> 
Yes
> Please, clean the patch:
> - it includes changes for othr projects (draw2d etc)
Part of the fix is in draw2d, I removed this part and added it in a separate
patch in bug # 274567
> - it includes the changes I released for surrogates last week
You mean changed in TextLayout.java? if yes I made synchronize with repository before creating the patch ,any step am missing ?
> - it has a funny method in Resource:
The reason of adding this method is to avoid adding getSystemDigitSubistitution
in each TextLayout.java for each platform,so adding them once in the parent.
As only am interested in detecting contextual behavior I changed the method to public boolean isContextDigitSubistitution()
please advise if it should be placed somewhere else and how to propagate it in other platforms


> 
> public int getSystemDigitSubistitution(){ 
>    int digitSub=-1; 
>    return digitSub; 
> }
> 
> it has one method that seems to do something in TextLayout:
> /* 
>  * Returns the following  
>  * 0 when Contextual Digit Substitution is selected  
>  * 1 when None Digit Substitution is selected  
>  * 2 when National Digit Substitution is selected 
>  */ 
> public int getSystemDigitSubistitution(){ 
> 
>     SCRIPT_DIGITSUBSTITUTE scriptDigitSubistitue= new SCRIPT_DIGITSUBSTITUTE(); 
>     
> OS.ScriptRecordDigitSubstitution(OS.LOCALE_USER_DEFAULT,scriptDigitSubistitue); 
>      return scriptDigitSubistitue.DigitSubstitute; 
> } 
> 
> (I suppose this is the only method you really need...)
> 
> - no need to add your name to the copyright (you work for IBM)
Comment 6 Dina Sayed CLA 2011-03-31 11:49:40 EDT
Created attachment 192296 [details]
Proposed patch
Comment 7 Felipe Heidrich CLA 2011-04-01 10:52:59 EDT
shouldn't your patch only include this one method:

 /* 
 * if the digit substitution selected is contextual return true, otherwise return false 
*/ 
  
public boolean isContextDigitSubistitution(){ 
	SCRIPT_DIGITSUBSTITUTE scriptDigitSubistitue= new SCRIPT_DIGITSUBSTITUTE(); 
	OS.ScriptRecordDigitSubstitution(OS.LOCALE_USER_DEFAULT,scriptDigitSubistitue); 
	if(scriptDigitSubistitue.DigitSubstitute==0) 
		return true; 
	return false; 
} 

?
why did you change it from int to boolean ? What is the answer for Linux and Mac (see comment 4).

The patch still have several changes to TextLayout to should not be there (the surrogate stuff).
Comment 8 Felipe Heidrich CLA 2011-04-18 15:27:36 EDT
Hi Dina, this is just a reminder that feature freeze is next week. We need all new API in before that.
Comment 9 Dani Megert CLA 2011-04-19 02:27:08 EDT
(In reply to comment #8)
> Hi Dina, this is just a reminder that feature freeze is next week. We need all
> new API in before that.

...and you need API approval from the PMC for any API changes, including additions.
Comment 10 Lars Vogel CLA 2019-11-14 03:41:28 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.