FreeType engine+TrueType fonts for rendering South Indian languages?

395 views
Skip to first unread message

devi prasad

unread,
Jul 25, 2011, 9:17:44 AM7/25/11
to andro...@googlegroups.com
Hi, is it still true that Android requires UTF-16 encoding for
TrueType fonts? Is the FreeType rendering engine capable of rendering
Dravidian languages
(http://en.wikipedia.org/wiki/Dravidian_languages)?

FYI, I've compiled, using NDK r6, the FreeType library (pulled from
AOSP) along with Skia (skia.googlecode.com), and played around with a
few text rendering examples. I'm wondering if I can use this engine to
render South Indian languages (such as Kannada:
http://en.wikipedia.org/wiki/Kannada_language).

Thanks for your insights.
dp

Tim Mensch

unread,
Jul 25, 2011, 5:22:42 PM7/25/11
to andro...@googlegroups.com
On 7/25/2011 7:17 AM, devi prasad wrote:
> Is the FreeType rendering engine capable of rendering
> Dravidian languages
> (http://en.wikipedia.org/wiki/Dravidian_languages)?
FreeType can render anything you can get in a Unicode font. I use
FreeType with UTF-8, which is going to give you MUCH less of a headache
in NDK code.

Some languages (at least Arabic) require a preprocessing step before you
can render them in FreeType (apparently Arabic words are written in a
form of cursive where each letter's look varies based on adjacent
letters). I don't know if Dravidian languages need that.

Tim

devi prasad

unread,
Jul 26, 2011, 12:32:31 PM7/26/11
to andro...@googlegroups.com
Thank you, Tim, for the positive words that I need now to explore the
possibilities!

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

David Turner

unread,
Aug 3, 2011, 6:38:16 AM8/3/11
to andro...@googlegroups.com
On Mon, Jul 25, 2011 at 3:17 PM, devi prasad <dpra...@gmail.com> wrote:
Hi, is it still true that Android requires UTF-16 encoding for
TrueType fonts?

No, it never did, UTF-16 is a way to encode/compress sequences of Unicode code points in memory, this has nothing to do with character maps found in TrueType fonts.
 
Is the FreeType rendering engine capable of rendering
Dravidian languages
(http://en.wikipedia.org/wiki/Dravidian_languages)?

FreeType only renders individual glyphs. If you want to render sophisticated text (e.g. which requires contextual substituion or positioning) you will have to do that yourself on top of the font engine.
 
FYI, I've compiled, using NDK r6, the FreeType library (pulled from
AOSP) along with Skia (skia.googlecode.com), and played around with a
few text rendering examples. I'm wondering if I can use this engine to
render South Indian languages (such as Kannada:
http://en.wikipedia.org/wiki/Kannada_language).


I don't think it's properly supported at the moment (iirc, there is some code to do it, but it is incomplete, not used, and trying to use it forcefully will result in slightly incorrect results).
 
Thanks for your insights.
dp

devi prasad

unread,
Aug 4, 2011, 3:47:32 AM8/4/11
to andro...@googlegroups.com
Hi, David - thank you for your response. I know I'm reading the most
authentic answer with respect to FreeType!

I used HarfBuzz on top of FreeType to get SkPaint draw UTF-16 encoded
strings of required typeface on Android Canvas (SkCanvas). After
hacking this POC, we are now trying to get some decent implementation
around the same scheme.

Thank you!
devi prasad

Reply all
Reply to author
Forward
0 new messages