JAVAFX on ANDROID

Felipe Heidrich felipe.heidrich at oracle.com
Mon Oct 14 08:45:04 PDT 2013


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 PrismFontFactory.java (but used by FontConfigManager.java).
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/OS.java

During runtime you will need to explicitly set "-Dprism.text=native" so that PangoFactory.java is used (instead of T2KFactory.java).

Note: if that is too hard to build pango.o I suppose you could link javafx-font-pango.so 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 ultramixer.com> 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