Matthias Hänel haenel at
Tue Oct 15 00:07:06 PDT 2013

Hi Felipe,

thanks for your fast answer.

Unfortunately, this is not enough information for a sufficient solution ;)
Maybe I am too far from gradle away in my thinking (Makefiles) to understand this one fully.

I know where the sources are and I am pretty sure I can build a library by hand. Actually, I added 
to the android gradle script the Linux fontpango parts and the pkg-config tool.

I assume that the default linux gradle script looks for the pango libs in /usr/share ...
(default paths). Now we are in a cross platform enviornment for Android. At least I have to call
./configure with the android toolchain. That should not be hard to do.

What I don't know is, how do I add this to the gradle script?
I see the pkg-config in crosslibs but that relies on the assumption that pango resides
somewhere in ${SYSROOT}. 

Well, I probably could build pango (haven't tried yet) for android and put it in the NDK, 
from my point of view, that wouldn't work later at run time. The .so must be linked and 
delivered with the App. Maybe someone can enlighten me how I can integrate a third party 
library build into the gradle universe ;) 


Am 14.10.2013 um 17:45 schrieb Felipe Heidrich <felipe.heidrich at>:

> Hi, I'm not familiar with the Android build process but basically this is what you need:
> Build graphics/src/main/native-font/fontpath_linux.c to a library called "javafx_font", that it will be loaded by (but used by
> This is our fontconfig binding used to locate fonts. All references to fontconfig in the native code are dynamic, so you should only need the JNI references while building this object.
> Build 
> graphics/src/main/native-font/freetype.c
> and
> graphics/src/main/native-font/pango.c
> To a library named "javafx-font-pango"
> The cc flags to build them are "pkg-config --cflags pangoft2" + "-D_ENABLE_PANGO", the lib flags are pkg-config --libs pangoft2
> (see rt/buildSrc/linux.gradle, search pangoCCFlags and pangoLinkFlags).
> This library will be used by graphics/src/main/java/com/sun/javafx/font/pango/
> During runtime you will need to explicitly set "-Dprism.text=native" so that is used (instead of
> Note: if that is too hard to build pango.o I suppose you could link only with freetype.o, you should not see any unsatisfied link exception as long as PangoFactory.createGlyphLayout is not called.
> Setting -Dprism.debugfonts=true should help to see what is getting loaded, -Djavafx.verbose=true prints what library as being loaded by JFX.
> Regards,
> Felipe
> On Oct 13, 2013, at 11:49 PM, Matthias Hänel <haenel at> wrote:
>> Is there a fallback? Pango doesn't work either it's not used in the android gradle scripts. 
>> I would be happy to integrate it and I am sure I can compile pango for android. I just need a pointer to how I can integrate it into the build process.
>> I changed android.gradle but I am not sure where to put the pango sources.

More information about the openjfx-dev mailing list