Re: Using Pango for text rendering on Android



On 14-07-09 08:29 AM, György Kövesdi wrote:
Hi,

I have a multi-platform project which needs software rendering of
graphical primitives (lines, circles, etc) and international text into
memory pixmaps.
Pango seems to be a good choice for this purpose, and it works perfectly
for me on some different Linux platforms, including embedded devices.
Recently I ported it to Android (based on
http://dev.laptop.org/git/users/cscott/android-libs ) and it works fine,
except that the initialization time is 2 minutes (!) on my fastest
device (1.7 GHz CPU). According to debug results, the fontconfig
initialization is guilty. It makes the application completely unusable,
however, the rendering speed is perfect (after the initialization has
been completed).

Any ideas would be appreciated to resolve this problem.

Try fontconfig from master.  It should be significantly faster.  I also have
an experimental patch that is not good enough for merging, but should be good
enough for you to use.  Please report your findings.  Patch attached here:

  https://bugs.freedesktop.org/show_bug.cgi?id=64766#c31

Also, if you can configure fontconfig to cache the fonts on the device, that
should make it fast to start up subsequently.

My questions are:

- Is it possible to use the Android built-in Java-based font rendering?
IMHO it would be the better solution. I found some articles about it on
the net, but could not find real solution.

Using Android text rendering from an Android app?  Yes, I'm sure it's possible
:).  From a native app?  I don't know.


- Can I use other font-render backends for Pango?

You can't use CoreText and Win32, so you are left with fontconfig one, unless
you are willing to write a new one.


- Is there any similar solution other than Pango?

There's no other full solution that I know of.


-- 
behdad
http://behdad.org/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]