Gingerbread and BiDi

278 views
Skip to first unread message

Shachar Shemesh

unread,
Dec 7, 2010, 4:05:35 AM12/7/10
to android-platform
Hi,

The highlights[1] for Gingerbread include the following line:

> Expanded I18N support (full worldwide encodings, more locales)
That, along with Romain Guy's comments on a patch of mine[2] gave me
hope that bidirectional languages support is going to be better in
Gingerbread. As a reminder, there was a small regression between Eclair
and Froyo, except that Froyo installed the Hebrew and Arabic fonts by
default. Froyo was, therefor, more usable out of the box, but less well
supported over all. Looking at the source, Froyo made a step forward in
introducing a class for directly using ICU's native Bidi, but this class
is not documented in the docs and is unused by the framework.

I downloaded Gingerbread and ran it on an emulator, and it seems to be
EXACTLY the same as Froyo. Numbers are still displayed from right to
left when in Hebrew context. Hebrew paragraphs are still left aligned by
the layout controls. This is the exact state Froyo was in. I could not
test Calendar, because it was not bundled with the SDK images for either
native or Google API SDKs.

What I would like to know is whether there is any roadmap of expected
BiDi support state for future versions of the SDK?

Thanks,
Shachar

1 - http://developer.android.com/sdk/android-2.3-highlights.html
2 - https://review.source.android.com//#change,18517

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

Romain Guy

unread,
Dec 7, 2010, 4:14:13 AM12/7/10
to android-...@googlegroups.com
I wasn't referring to Gingerbread :)


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
Romain Guy
Android framework engineer
roma...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support.  All such questions should be posted on public forums, where I and others can see and answer them

Romain Guy

unread,
Dec 7, 2010, 4:14:53 AM12/7/10
to android-...@googlegroups.com
Please note that full BiDi support is not planned in Honeycomb. I'd like to have better BiDi and RTL layouts support after Honeycomb but I cannot promise you anything at this point.

Shachar Shemesh

unread,
Dec 7, 2010, 4:45:23 AM12/7/10
to android-...@googlegroups.com
On 07/12/10 11:14, Romain Guy wrote:
Please note that full BiDi support is not planned in Honeycomb. I'd like to have better BiDi and RTL layouts support after Honeycomb but I cannot promise you anything at this point.

On Tue, Dec 7, 2010 at 1:14 AM, Romain Guy <roma...@android.com> wrote:
I wasn't referring to Gingerbread :)

Fine, got it.

Any chance you can make the API development process more open? As I think you have seen for yourself, it is possible to make quite fundamental errors in the design of the APIs, and a public process to develop the APIs definitions (if not implementation, though I would really love for that to be the case too) would go a long way toward help prevent more bad interfaces from being defined.

Put another way - I want to help. Will that be possible? :-)

Shachar

Pär Spjuth

unread,
Dec 7, 2010, 10:11:21 AM12/7/10
to android-platform
I second that. We really need an open API discussion about this to
avoid fragmentation in this case. The implementation as such is
another matter, once a robust API has been defined.

Regards,
Pär Spjuth
Sony Ericsson Developer


On 7 Dec, 11:45, Shachar Shemesh <shac...@shemesh.biz> wrote:
> On 07/12/10 11:14, Romain Guy wrote:> Please note that full BiDi support is not planned in Honeycomb. I'd
> > like to have better BiDi and RTL layouts support after Honeycomb but I
> > cannot promise you anything at this point.
>

Bashar

unread,
Dec 11, 2010, 5:40:37 PM12/11/10
to android-platform
Lots of vendors like samsung and htc has built this officially into
their custom android releases and works like charm, why not get it
into android ? adding broken locales doesn't help novice users love
android but makes them run away.

on the other hand people like Shachar have been working on getting
BiDi support and even released functional patches to the users to
apply for their devices to support connecting letters and/or adding
RTL support.

for me as advanced user i just downloaded a lib update from ardoid.com
applied it after rooting my device and my Froyo reads/writes natively
arabic with no issues at all

but not all users know these steps :)

any specific reason not having it since its already out there ? so i
can answer people who asks


Best Regards,
--
Bashar


On Dec 7, 12:14 pm, Romain Guy <romain...@android.com> wrote:
> Please note that full BiDi support is not planned in Honeycomb. I'd like to
> have better BiDi and RTL layouts support after Honeycomb but I cannot
> promise you anything at this point.
>
>
>
> On Tue, Dec 7, 2010 at 1:14 AM, Romain Guy <romain...@android.com> wrote:
> > I wasn't referring to Gingerbread :)
>
> > On Tue, Dec 7, 2010 at 1:05 AM, Shachar Shemesh <shac...@shemesh.biz>wrote:
>
> >> Hi,
>
> >> The highlights[1] for Gingerbread include the following line:
>
> >>  Expanded I18N support (full worldwide encodings, more locales)
>
> >> That, along with Romain Guy's comments on a patch of mine[2] gave me hope
> >> that bidirectional languages support is going to be better in Gingerbread.
> >> As a reminder, there was a small regression between Eclair and Froyo, except
> >> that Froyo installed the Hebrew and Arabic fonts by default. Froyo was,
> >> therefor, more usable out of the box, but less well supported over all.
> >> Looking at the source, Froyo made a step forward in introducing a class for
> >> directly using ICU's native Bidi, but this class is not documented in the
> >> docs and is unused by the framework.
>
> >> I downloaded Gingerbread and ran it on an emulator, and it seems to be
> >> EXACTLY the same as Froyo. Numbers are still displayed from right to left
> >> when in Hebrew context. Hebrew paragraphs are still left aligned by the
> >> layout controls. This is the exact state Froyo was in. I could not test
> >> Calendar, because it was not bundled with the SDK images for either native
> >> or Google API SDKs.
>
> >> What I would like to know is whether there is any roadmap of expected BiDi
> >> support state for future versions of the SDK?
>
> >> Thanks,
> >> Shachar
>
> >> 1 -http://developer.android.com/sdk/android-2.3-highlights.html
> >> 2 -https://review.source.android.com//#change,18517
>
> >> --
> >> Shachar Shemesh
> >> Lingnu Open Source Consulting Ltd.
> >>http://www.lingnu.com
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> To post to this group, send email to android-...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> android-platfo...@googlegroups.com<android-platform%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-platform?hl=en.
>
> > --
> > Romain Guy
> > Android framework engineer
> > romain...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support.  All such questions should be posted on public
> > forums, where I and others can see and answer them
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com

Shachar Shemesh

unread,
Dec 12, 2010, 3:53:32 PM12/12/10
to android-...@googlegroups.com, Bashar
On 12/12/10 00:40, Bashar wrote:
> Lots of vendors like samsung and htc has built this officially into
> their custom android releases and works like charm, why not get it
> into android ? adding broken locales doesn't help novice users love
> android but makes them run away.
>
> on the other hand people like Shachar have been working on getting
> BiDi support and even released functional patches to the users to
> apply for their devices to support connecting letters and/or adding
> RTL support.
>
> for me as advanced user i just downloaded a lib update from ardoid.com
> applied it after rooting my device and my Froyo reads/writes natively
> arabic with no issues at all
>
> but not all users know these steps :)
>
> any specific reason not having it since its already out there ? so i
> can answer people who asks
>
The existing patches that are circulating are not "the right solution".
They do not completely solve all problems[1], and are breaking the
current documented API[2]. The current API is too incomplete to
completely describe the full scale of a BiDi sentence[3], even when no
BiDi control characters are employed. As a result, I can totally agree
with Google not accepting the patches as circulating (and as integrated
into CyanogenMod) into the main SDK.

That said, I think that these APIs should be respected. The circulating
APIs change the semantics of Canvas.drawText to include BiDi, and adds
another overloaded version which accepts whether to perform BiDi as a
boolean option[4]. While I'm not sure that would have been my first
choice in implementing this solution, I think it should be blessed as
official, if only because it's so widely used in the relevant markets.

That's why I wanted the API design process to be open to the community.
The lack of response to that request does not leave me overly
optimistic, however :-(

Shachar

1 - Diacritics, at least in Hebrew (though I can't imagine Arabic being
any different) still cause the text to be displayed left to right. The
number of places the patch introduces BiDi is so big that I have not
managed to figure out where the problem comes from, yet.
2 - See the last part of the last sentence of the class overview for
StaticLayout
(http://developer.android.com/reference/android/text/StaticLayout.html).
Canvas.drawText is reported not to do BiDi, which, with these patches,
it does.
3 -
http://developer.android.com/reference/android/text/StaticLayout.html#getLineDirections%28int%29
is in adequate to describe a left to right paragraph containing a right
to left sequence followed by numbers. If the API continues to rely on
Layout.Directions, full BiDi support will never happen.
4 -
http://github.com/dudyk/android_frameworks_base/commit/1b0aca31c3e03a5a323276cd15a8df4203a1792c

Romain Guy

unread,
Dec 13, 2010, 3:07:17 AM12/13/10
to android-...@googlegroups.com
Hi,

BiDi text support and RTL layouts in general is something we know is important. We are also aware of the inadequacies of our APIs in this matter. A little bit was done in Honeycomb to add better BiDi support (to Canvas in particular) with a new API called drawTextRun(). Unfortunately nothing has been done so far about RTL layouts.

I work on the UI toolkit and 2D drawing APIs and I would like to see both full BiDi text support and RTL layout support happen as soon as possible. I will keep the community (you :) informed as soon as I can give you better answers. Given the obvious interest of the community I would like you to be included as much as possible (although this is by no means a commitment nor a promise at this point.) 

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
Romain Guy
Android framework engineer

omri

unread,
Dec 13, 2010, 8:12:20 AM12/13/10
to android-platform
Just wanted to jump in and say that I would also like to see a more
open process about the BiDi support. (I wrote the BiDi digits patch in
CyanogenMod)

On Dec 13, 10:07 am, Romain Guy <romain...@android.com> wrote:
> Hi,
>
> BiDi text support and RTL layouts in general is something we know is
> important. We are also aware of the inadequacies of our APIs in this matter.
> A little bit was done in Honeycomb to add better BiDi support (to Canvas in
> particular) with a new API called drawTextRun(). Unfortunately nothing has
> been done so far about RTL layouts.
>
> I work on the UI toolkit and 2D drawing APIs and I would like to see both
> full BiDi text support and RTL layout support happen as soon as possible. I
> will keep the community (you :) informed as soon as I can give you better
> answers. Given the obvious interest of the community I would like you to be
> included as much as possible (although this is by no means a commitment nor
> a promise at this point.)
>
> >http://developer.android.com/reference/android/text/StaticLayout.html...in adequate to describe a left to right paragraph containing a right to
> > left sequence followed by numbers. If the API continues to rely on
> > Layout.Directions, full BiDi support will never happen.
> > 4 -
> >http://github.com/dudyk/android_frameworks_base/commit/1b0aca31c3e03a...
>
> > --
> > Shachar Shemesh
> > Lingnu Open Source Consulting Ltd.
> >http://www.lingnu.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib e...@googlegroups.com>
> > .
>
> > For more options, visit this group at
> >http://groups.google.com/group/android-platform?hl=en.
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com

bas...@gmail.com

unread,
Dec 13, 2010, 10:37:15 AM12/13/10
to Shachar Shemesh, android-...@googlegroups.com
Both samsung galaxy S and htc desire has RTL support officially into their middle eastern releases of the devices

Sent from my BlackBerry® smartphone from Zain Kuwait

yakir zana

unread,
Dec 18, 2010, 2:02:34 PM12/18/10
to android-platform
it is very important to add bidi support.
the most of the users have a big problems to fix it.
i hope it fix soon
> > >http://developer.android.com/reference/android/text/StaticLayout.html...adequate to describe a left to right paragraph containing a right to
> > > left sequence followed by numbers. If the API continues to rely on
> > > Layout.Directions, full BiDi support will never happen.
> > > 4 -
> > >http://github.com/dudyk/android_frameworks_base/commit/1b0aca31c3e03a...
>
> > > --
> > > Shachar Shemesh
> > > Lingnu Open Source Consulting Ltd.
> > >http://www.lingnu.com
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "android-platform" group.
> > > To post to this group, send email to android-...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib e...@googlegroups.com>
> > > .
>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-platform?hl=en.
>
> > --
> > Romain Guy
> > Android framework engineer
> > romain...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support.  All such questions should be posted on public
> > forums, where I and others can see and answer them-הסתר טקסט מצוטט-
>
> -הראה טקסט מצוטט-

Afriza N. Arief

unread,
Jan 27, 2011, 7:13:02 PM1/27/11
to android-platform
Is this issue solved? Considering a nice arabic localization found in
honeycomb preview http://bit.ly/honeycomb-arabic
> > > >http://developer.android.com/reference/android/text/StaticLayout.html...to describe a left to right paragraph containing a right to

Shachar Shemesh

unread,
Jan 30, 2011, 12:33:02 AM1/30/11
to android-...@googlegroups.com, Afriza N. Arief
On 28/01/11 02:13, Afriza N. Arief wrote:
> Is this issue solved? Considering a nice arabic localization found in
> honeycomb preview http://bit.ly/honeycomb-arabic
>
Our discussion so far was about the core technology support (what is
called internationalization, or i18n). What these pictures show is
actual translations (localization, or l10n). The two are almost independent.

These pictures do not answer the question, as the constructs used to
display the Settings page are higher level constructs, while the change
that was due for Honeycomb was to add BiDi support for Canvas.drawText.
The pictures do show a nice shaping engine in place (though I have not
seen any Lam-Alef combination nor any use of diacritics, so I'll reserve
final judgment until I do or test it myself).

I tried to test it myself, but have been too busy to do anything more
than merely download the image and run the emulator. I did notice
frequent acore process failures as soon as I set the language to Hebrew.

Shachar

Reply all
Reply to author
Forward
0 new messages