Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,305 Members 44,372 Now Online
XDA Developers Android and Mobile Development Forum

[WIP] Open source RTL support for Android

Tip us?
 
dudyk
Old
#1  
Member - OP
Thanks Meter 0
Posts: 41
Join Date: Mar 2010
Default [WIP] Open source RTL support for Android

I am working on an open source RTL support for Android and I need help testing...

I have attached a normal app (that should work on any Android 1.5 and up) that runs my method before calling drawText.
The purpose is to make drawText call to it so it will support BiDi.

It reads a file called /sdcard/test.txt from which it gets the test string.
It does not support newlines.

Try it and tell me what you think.

The reason I don't publish the source yet is because knowing how it works would prevent it from being tested properly.

I hope I'm putting this in the right forum...
Attached Files
File Type: apk biditest.apk - [Click for QR Code] (9.1 KB, 392 views)
 
TheAgent1982
Old
#2  
Senior Member
Thanks Meter 33
Posts: 748
Join Date: Sep 2007

 
DONATE TO ME
Question Hebrew Supported...

Is it also, support the font for Hebrew?

Because in ver 2.1, the have Hebrew but sometimes you see square or ? signs.
If you like my work...
For more experience and teaching!

Please Donate
USD EUR ISL


HTC HD2 (aka LEO) T8585
ROM:
EnergyROM "LEO" Series
VS
ANDROID MDJ Series
Radio: 2.15.50.14 ( Lastest Official HD2 Rhodium Radio )

HTC Touch Pro 2
ROM:
EnergyROM 3.0 "LEO" Series
Radio: 4.49.25.91 (Lastest Official TP2 Rhodium Radio)

HTC Touch Pro - SOLD
ROM: EnergyROM 3.0 "Warhawk" Series
Radio: 1.14.25.05 ( Official Raphael Radio )
 
dudyk
Old
#3  
Member - OP
Thanks Meter 0
Posts: 41
Join Date: Mar 2010
Quote:
Originally Posted by TheAgent1982 View Post
Is it also, support the font for Hebrew?

Because in ver 2.1, the have Hebrew but sometimes you see square or ? signs.
The fonts exist, there's no work necessary on them, you have to push them to the device and that's it...
Faulty (no power management and no USB) AT&T N1 running CM7 personal build
Samsung Captivate running CM7 personal build
Samsung Galaxy Tab (EU) Running stock 2.2.

I did the RTL support improvements and integrated Arabic reshaping in CM5,6,7.
And various other changes in CM and in AnySoftKeyboard.
My github
If you like what I do, you can help me buy more android devices.
 
afriza
Old
(Last edited by afriza; 15th June 2010 at 07:09 AM.)
#4  
afriza's Avatar
Junior Member
Thanks Meter 3
Posts: 14
Join Date: Feb 2010
Default biditest with Android 2.2 FroYo (FRF50) Arabic test.txt

I tested with Android 2.2 FroYo (FRF50)

without /sdcard/test.txt and with my own text

I don't know about the Hebrew, the Arabic text are not joined (re-shaped) correctly
Attached Thumbnails
Click image for larger version

Name:	biditest.jpg
Views:	299
Size:	18.9 KB
ID:	343319   Click image for larger version

Name:	biditest-arabic.jpg
Views:	421
Size:	22.5 KB
ID:	343320  
Attached Files
File Type: txt test.txt - [Click for QR Code] (69 Bytes, 66 views)
 
TheAgent1982
Old
#5  
Senior Member
Thanks Meter 33
Posts: 748
Join Date: Sep 2007

 
DONATE TO ME
Quote:
Originally Posted by dudyk View Post
The fonts exist, there's no work necessary on them, you have to push them to the device and that's it...
I have TP2 running Android 2.1 .
So, any idea how to do it?
If you like my work...
For more experience and teaching!

Please Donate
USD EUR ISL


HTC HD2 (aka LEO) T8585
ROM:
EnergyROM "LEO" Series
VS
ANDROID MDJ Series
Radio: 2.15.50.14 ( Lastest Official HD2 Rhodium Radio )

HTC Touch Pro 2
ROM:
EnergyROM 3.0 "LEO" Series
Radio: 4.49.25.91 (Lastest Official TP2 Rhodium Radio)

HTC Touch Pro - SOLD
ROM: EnergyROM 3.0 "Warhawk" Series
Radio: 1.14.25.05 ( Official Raphael Radio )
 
torusJKL
Old
#6  
Junior Member
Thanks Meter 6
Posts: 27
Join Date: Oct 2009
Thanks for writing an open source BiDi support.

I did a very short test:

1. It did not render the whole line of text.
2. It looks like it has problems when switching from one language to another. E.g. the closing bracket after the hebrew word is rendered as open.

I attached the original text files and screen shots.
In addition I attache a screen shot of TxtPad Light and how it is rendered there.

Quote:
Originally Posted by TheAgent1982
Is it also, support the font for Hebrew?

Because in ver 2.1, the have Hebrew but sometimes you see square or ? signs.
This might be a problem of character encoding.
I did a test with a UTF-8 file and a Hebrew ISO 8859-8. The first rendered the letters correct but the second showed only question marks. (See picture)

As alternative keyboard I recommend using either AnySoftKeyboard or SmartKeyboard.
Attached Thumbnails
Click image for larger version

Name:	BiDiTest_Utf-8.png
Views:	185
Size:	12.3 KB
ID:	346502   Click image for larger version

Name:	BiDiTest_Hebrew_ISO-8859-8.png
Views:	210
Size:	13.9 KB
ID:	346503   Click image for larger version

Name:	BiDi_TxtPadLight.png
Views:	222
Size:	58.6 KB
ID:	346504  
Attached Files
File Type: txt test_utf8.txt - [Click for QR Code] (82 Bytes, 28 views)
File Type: txt test_hebrew_iso-8859-8.txt - [Click for QR Code] (49 Bytes, 30 views)
Phone: Galaxy Nexus
Rom: SlimKat
Recovery: TWRP
 
dudyk
Old
#7  
Member - OP
Thanks Meter 0
Posts: 41
Join Date: Mar 2010
It is in CM-5.0.8, with a fix on the issue list.
Faulty (no power management and no USB) AT&T N1 running CM7 personal build
Samsung Captivate running CM7 personal build
Samsung Galaxy Tab (EU) Running stock 2.2.

I did the RTL support improvements and integrated Arabic reshaping in CM5,6,7.
And various other changes in CM and in AnySoftKeyboard.
My github
If you like what I do, you can help me buy more android devices.
 
ClassicalDude
Old
(Last edited by ClassicalDude; 3rd July 2010 at 05:18 AM.)
#8  
Member
Thanks Meter 30
Posts: 43
Join Date: Sep 2007
Dear Dudy,

Will your fix work for 2.1 as well? Can you give directions how to apply it to other ROMs? I own an HTC Desire, and would love to implement the fix. So far I just have the common StaticLayout fix.

Thanks,

Ron

EDIT: More specifically, it would be great if you can tell us which files to take from the CM update with the help of baksmali and smali in order to graft them into other distros. That's the way I implanted StaticLayout.smali in MoDaCo roms.
 
dudyk
Old
#9  
Member - OP
Thanks Meter 0
Posts: 41
Join Date: Mar 2010
CM 5.0.8 is 2.1. It should apply to any 2.1/2.2 rom, just take my 4 commits from CM's git from framework base repository.
Faulty (no power management and no USB) AT&T N1 running CM7 personal build
Samsung Captivate running CM7 personal build
Samsung Galaxy Tab (EU) Running stock 2.2.

I did the RTL support improvements and integrated Arabic reshaping in CM5,6,7.
And various other changes in CM and in AnySoftKeyboard.
My github
If you like what I do, you can help me buy more android devices.
 
ClassicalDude
Old
(Last edited by ClassicalDude; 3rd July 2010 at 03:14 PM.)
#10  
Member
Thanks Meter 30
Posts: 43
Join Date: Sep 2007
Quote:
Originally Posted by dudyk View Post
CM 5.0.8 is 2.1. It should apply to any 2.1/2.2 rom, just take my 4 commits from CM's git from framework base repository.
Thanks for the reply, Dudy. I'll be more specific about what I am trying to do: I am trying to pull the files with your patches from the CM-5.0.8 ROM without compiling anything.

With the StaticLayout fix, I used baksmali and smali to disassemble the classes.dex from framework.jar and replace StaticLayout.smali. This worked.

When I look at the page github.com/dudyk/android_frameworks_base/commit/1b0aca31c3e03a5a323276cd15a8df4203a1792c - the one with your commits (is that the right one?) I cannot figure out all the files that I would need to replace. Sorry, I am not a programmer...

I can pretty much figure out that all the files preceeded by core/java/android/ will be found with their exact names in the classes.dex from framework.jar. But I have no idea where to locate the compiled files that resulted from AndroidGraphics2D, the three Canvas files and the ResourceTypes.

If you can point me at the right direction I'll be able to convert a script that was used for the StaticLayout fix so that anyone with a Mac or Linux would be able to easily implement your fix to any none-odexed distro.

Thanks so much in advance!

Tags
android, arabic, bidi, hebrew, rtl
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...