After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755375 - Fonts not copied properly on Android.
Fonts not copied properly on Android.
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: cerbero
1.5.90
Other other
: Normal blocker
: 1.6.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-21 21:28 UTC by Carl Kovamees
Modified: 2015-09-23 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Carl Kovamees 2015-09-21 21:28:39 UTC
I noticed that the clockoverlay only displayed 00000000 on Android.

The Java code GStreamer.Init() copies from assets/fontconfig/fonts/truetype

However, the single font checked in (Ubuntu-R.ttf) is in ndk-build/fontconfig/fonts.

Adding the truetype folder and moving the font file there makes the clockoverlay display correctly.
Comment 1 Nicolas Dufresne (ndufresne) 2015-09-22 01:50:44 UTC
To be fair, in some project I just replaced that to point to Android font directory (with manually written fontconfig index) and that work fine (and was consistent with other apps). I never had the time to write a proper patch, but it should not be hard.
Comment 2 Sebastian Dröge (slomo) 2015-09-22 10:29:55 UTC
(In reply to Nicolas Dufresne (stormer) from comment #1)
> To be fair, in some project I just replaced that to point to Android font
> directory (with manually written fontconfig index) and that work fine (and
> was consistent with other apps). I never had the time to write a proper
> patch, but it should not be hard.

Would this work on all devices? If so, a patch would be great ;)


Should we think of integrating your yet-to-be-written patch into 1.6.0, or rather just fix that path in cerbero?
Comment 3 Nicolas Dufresne (ndufresne) 2015-09-22 15:36:38 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Would this work on all devices? If so, a patch would be great ;)

I'd need to test, it's likely the "standard" font sets was introduced much later then what we pretend we support. So it might mean raising up the minimum requirement (which is quite old now anyway), but that's not good for 1.6.

> Should we think of integrating your yet-to-be-written patch into 1.6.0, or
> rather just fix that path in cerbero?

The would be to risky, if we have path issue it must be a simple regression, so let's just fix that and stick with our single font for now.
Comment 4 Sebastian Dröge (slomo) 2015-09-22 17:52:05 UTC
This works just fine for me as is. The <dir> directives in fonts.conf are for the top-level dir, it looks recursively in all subdirectories then.

Is your application setting XDG_DATA_HOME manually to something else, or not using the GStreamer.init() Java method?
Comment 5 Sebastian Dröge (slomo) 2015-09-22 17:54:23 UTC
Also for reference, the font is in assets/fontconfig/fonts/truetype for me. The fonts.conf is in assets/fontconfig and pointing to $XDG_DATA_HOME/fontconfig/fonts. GStreamer.java is copying to $XDG_DATA_HOME/fontconfig/fonts/truetype
Comment 6 Carl Kovamees 2015-09-23 00:18:54 UTC
The font is in http://cgit.freedesktop.org/gstreamer/sdk/cerbero/tree/data/ndk-build/fontconfig/fonts/Ubuntu-R.ttf

When I unzip the android package it goes into: share/gst-android/ndk-build/fontconfig/fonts

There is no truetype sub-directory. That is the problem.

When the GStreamer.init() copies the fonts, it's looking for the for "fontconfig/fonts/truetype", that doesn't exist by default.

for(String filename : assetManager.list("fontconfig/fonts/truetype")) {
                File font = new File(fontsDir, filename);
                copyFile (assetManager, "fontconfig/fonts/truetype/" + filename, font);
            }


The only thing I had to do was to create the truetype directory and move the font there.

I made no other changes, not altering font.config etc. GStreamer.init() was executed and set all the paths etc as you describe. XDG_DATA_HOME is set in gstreamer_andoir-1.0.c and the method gst_android_init (called from GStreamer.init().
Comment 7 Nicolas Dufresne (ndufresne) 2015-09-23 01:17:45 UTC
If you where using the provided makefile, you'd this would be copied to the right location in your project.

See ndk-build/gstreamer-1.0.mk:
copyfontsres_$(TARGET_ARCH_ABI):
	@$(call host-mkdir,assets/fontconfig)
	@$(call host-mkdir,assets/fontconfig/fonts/truetype/)
	@$(call host-cp,$(GSTREAMER_NDK_BUILD_PATH)/fontconfig/fonts.conf,assets/fontconfig)
	@$(call host-cp,$(GSTREAMER_NDK_BUILD_PATH)/fontconfig/fonts/Ubuntu-R.ttf,assets/fontconfig/fonts/truetype)
copycacertificatesres_$(TARGET_ARCH_ABI):
	@$(call host-mkdir,assets/ssl/certs)
	@$(call host-cp,$(GSTREAMER_ROOT)/etc/ssl/certs/ca-certificates.crt,assets/ssl/certs)
Comment 8 Carl Kovamees 2015-09-23 01:23:21 UTC
Not a bug then - sorry to drag you guys though all this. Pls close.
Comment 9 Sebastian Dröge (slomo) 2015-09-23 07:28:04 UTC
How are you building your application?
Comment 10 Carl Kovamees 2015-09-23 13:22:48 UTC
Sebastian,

it's not a bug. I didn't use the provided makefiles. :-)

I copied the file structure as-is into my project. I use Android Studio 1.3.2 with a custom gradle file where I specified the needed modules/libraries. Then I did GST_PLUGINSTATIC_DECLARE and GST_PLUGIN_STATIC_REGISTER for those libraries in gstreamer_android-1.0.c.

This worked great, except that I screwed up the font copying.

I really like encodebin and all it does to find the HW Encoder etc. Worked like a charm on my Andorid device. Thanks to everyone that has contributed to all this great work!