Complex Text Rendering in Android

2,282 views
Skip to first unread message

Akila Wajirasena

unread,
Jan 10, 2011, 8:27:36 AM1/10/11
to skia-discuss, android-...@googlegroups.com
Hi,

I would like to add complex layout support for android (Specially in
Sinhala).
I need to know what APIs I should use for this and, If I'm going to
use a
layout engine what do think is most suitable?

Also can some one explain the steps of
text rendering involved in Android. I checked the Android source but I
could not
get a clear idea about the steps involved.

I found that complex text rendering is still not supported in
Android,
according to [1] there there is no open type layout engine in
Android.
Then I found that you have no plan to add this as a part of Skia API
[2],
but to add that as a port to skia [3].

And you have mentioned that you are not using HarfBuzz
and you prefer ICU or Pango over HarfBuzz [4].
You have also mentioned that you are using ICU for chromium,
but I found that you are now using HarfBuzz in Chrome for Linux.


[1] http://groups.google.com/group/android-platform/msg/0902020e94cdca43?hl=en
[2] http://code.google.com/p/skia/issues/detail?id=58
[3] http://code.google.com/p/skia/wiki/FAQ
[4] http://groups.google.com/group/skia-discuss/msg/098ae57c6ba38409

Romain Guy

unread,
Jan 10, 2011, 11:58:15 AM1/10/11
to android-...@googlegroups.com
Hi,

HarfBuzz is now used in Honeycomb.


--
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

Akila Wajirasena

unread,
Jan 11, 2011, 8:41:37 AM1/11/11
to android-platform
Thanks

Ravi

unread,
Jan 19, 2011, 12:13:00 AM1/19/11
to android-platform
Romain Guy,
I assume this would be old Harfbuzz rather than Harfbuzz-ng as only
the old one can render a far greater number of languages.

On Jan 11, 7:41 pm, Akila Wajirasena <akila.wajiras...@gmail.com>
wrote:
> Thanks

Ravi

unread,
Jan 19, 2011, 11:04:41 AM1/19/11
to android-platform
Akila,
If you wish to support Sinhalese you should not wait for Android to
officially support. As far are I know Harfbuzz-ng does not support
Indic. It would be a good idea to hook your shaper into Canvas.java.
At least that is what we have done based on what the Arabic world did.

/frameworks/base/graphics/java/android/graphics/Canvas.java

Look at drawText(). Call your shaper there, at least that is what we
have done for Burmese(Myanmar). I am positive that Harfbuzz-ng is not
going to support us this year. For the shaper you can check out
ArabicReShaper.

https://github.com/agawish/Better-Arabic-Reshaper

Apart from drawText() we still don't' know where else we should hook
our shaper, as shaping is not working on Notification Bar, and in some
of List Items in settings. We haven't started shaping for webkit yet
either. But it should be similar. If we get this working I can move to
Hindi and Punjabi as these are the two languages I understand. Also I
am not sure if Harfbuzz-ng will be back ported to 2.3 and earlier
releases. If it's not going to be, than working on the shaper now is a
good idea.
Regards,
Ravi

Sandeep sp

unread,
Jan 19, 2011, 10:22:56 PM1/19/11
to android-platform
@Ravi,

we have been working on webkit rendering, if it work's out. Will
pass the inputs to group.
http://groups.google.com/group/android-platform/browse_thread/thread/14dae28b42861a14#


Regards
Sandeep S.P
> > > Thanks- Hide quoted text -
>
> - Show quoted text -

Akila Wajirasena

unread,
Jan 21, 2011, 7:38:16 AM1/21/11
to android-platform
You can add new fonts to the system by changing
static const FontInitRec gSystemFonts[] in
/external/skia/src/ports/SkFontHost_android.cpp

Then add the font to /frameworks/base/data/fonts/
and then changing the Android.mk in the same folder to include he
font.

I have tried this with Sinhala and it works (only the font without
proper rending).

On Jan 20, 8:22 am, Sandeep sp <sandeep.palaksha...@wipro.com> wrote:
> @Ravi,
>
>     we have been working on webkit rendering, if it work's out. Will
> pass the inputs to group.
>    http://groups.google.com/group/android-platform/browse_thread/thread/...

Sandeep sp

unread,
Jan 23, 2011, 10:14:53 PM1/23/11
to android-platform
Hi Akila,

I Already followed this method and was able to get the corresponding
glyphs from the font file. But, the font rendering wasn't proper. Is
it anyway we can create our own font file, so that it will resolve all
these issues. (by having an proper indexing).

Regards
Sandeep S.P

On Jan 21, 5:38 pm, Akila Wajirasena <akila.wajiras...@gmail.com>
> > > - Show quoted text -- Hide quoted text -

Keith Stribley

unread,
Jan 22, 2011, 4:22:45 AM1/22/11
to android-platform
Romain,

If Honeycomb is using the old Harfbuzz, then please consider disabling
the Myanmar shaper in Harfbuzz, since it breaks modern Myanmar Unicode
fonts compliant with Unicode 5.1 and above. Fonts like Myanmar3 and
Padauk currently use just the default OpenType features and don't
require a specific shaper. Please see https://bugs.freedesktop.org/show_bug.cgi?id=31003
for details.
Keith

kariyachan

unread,
Jan 31, 2011, 9:43:12 PM1/31/11
to android-platform
Hi,

Thank you for this post .This help me to find how to add new font
to android source.
one problem remains how to add new Locale to android ??.

Kindly waiiting for your reply.


Thanks.
Kariya



On Jan 10, 8:27 am, Akila Wajirasena <akila.wajiras...@gmail.com>
wrote:
> Hi,
>
> I would like to add complex layout support for android (Specially in
> Sinhala).
> I need to know what APIs I should use for this and, If I'm going to
> use a
> layout engine what do think is most suitable?
>
> Also can some one explain the steps of
> text rendering involved in Android. I checked the Android source but I
> could not
> get a clear idea about the steps involved.
>
> I found that complex text rendering is still not supported in
> Android,
> according to [1] there there is no open type layout engine in
> Android.
> Then I found that you have no plan to add this as a part of Skia API
> [2],
> but to add that as a port to skia [3].
>
> And you have mentioned that you are not using HarfBuzz
> and you prefer ICU or Pango over HarfBuzz [4].
> You have also mentioned that you are using ICU for chromium,
> but I found that you are now using HarfBuzz in Chrome for Linux.
>
> [1]http://groups.google.com/group/android-platform/msg/0902020e94cdca43?...

Ruchi Shah

unread,
May 8, 2012, 3:21:02 AM5/8/12
to android-...@googlegroups.com, skia-discuss

I am currently working on a project to build a default Burmese android keyboard and add burmese to the locale also...
i have already added the locale, but i have some issues with the input method keyboard...
after using decimal code points still the font are not seen on the screen...All i get is white space...do you have any idea how i can go about it

Romain Guy

unread,
May 8, 2012, 12:27:36 PM5/8/12
to android-...@googlegroups.com, skia-discuss
Android 4.0 adds better support for complex script and the J release will further improve on it. We are now using a combination of ICU and Harbuzz.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/noW4Qp-rr-oJ.

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.
Reply all
Reply to author
Forward
0 new messages