Android L is for Lockdown

Root is, without a doubt, the (un)holy grail of the Android world. Those wonderful permissions that allow you as … more

XDA Xposed Tuesday: XHangouts Will Improve Your Hangouts

Ever since Google started supporting text messaging in Hangouts many people have … more

Shattered Screen? Turn Your Broken Device into a Complete Media Center!

A cracked screen usually means you’ll have to spend a hefty … more

Gmail 5.0: Material Design and Multiple Account Support

Google started to materialize many of its applications right after announcing the … more
Post Reply

[WIP] Open source RTL support for Android

OP dudyk

13th June 2010, 07:52 AM   |  #1  
OP Member
Thanks Meter: 0
 
41 posts
Join Date:Joined: Mar 2010
More
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)
13th June 2010, 08:13 AM   |  #2  
Senior Member
Thanks Meter: 33
 
751 posts
Join Date:Joined: Sep 2007
Donate to Me
More
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.
13th June 2010, 12:49 PM   |  #3  
OP Member
Thanks Meter: 0
 
41 posts
Join Date:Joined: Mar 2010
More
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.

The fonts exist, there's no work necessary on them, you have to push them to the device and that's it...
15th June 2010, 06:07 AM   |  #4  
afriza's Avatar
Junior Member
Thanks Meter: 3
 
14 posts
Join Date:Joined: Feb 2010
More
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)
Last edited by afriza; 15th June 2010 at 07:09 AM.
15th June 2010, 06:41 AM   |  #5  
Senior Member
Thanks Meter: 33
 
751 posts
Join Date:Joined: Sep 2007
Donate to Me
More
Quote:
Originally Posted by dudyk

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?
20th June 2010, 12:51 PM   |  #6  
Junior Member
Thanks Meter: 6
 
27 posts
Join Date:Joined: Oct 2009
More
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)
28th June 2010, 08:50 PM   |  #7  
OP Member
Thanks Meter: 0
 
41 posts
Join Date:Joined: Mar 2010
More
It is in CM-5.0.8, with a fix on the issue list.
2nd July 2010, 07:48 PM   |  #8  
Member
Thanks Meter: 30
 
43 posts
Join Date:Joined: 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.
Last edited by ClassicalDude; 3rd July 2010 at 05:18 AM.
3rd July 2010, 01:56 PM   |  #9  
OP Member
Thanks Meter: 0
 
41 posts
Join Date:Joined: Mar 2010
More
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.
3rd July 2010, 03:11 PM   |  #10  
Member
Thanks Meter: 30
 
43 posts
Join Date:Joined: Sep 2007
Quote:
Originally Posted by dudyk

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!
Last edited by ClassicalDude; 3rd July 2010 at 03:14 PM.

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes


Top Threads in Android by ThreadRank