Android: Load fonts from assets

Now fonts/ directory is bundled in APK as assets. TTF_OpenFont() can
open files in Android assets, but cannot handle the "./" path prefix.
This commit is contained in:
kichikuou
2019-12-31 21:18:23 +09:00
parent 8588a0033c
commit 070a2f8105
3 changed files with 9 additions and 5 deletions
+6
View File
@@ -34,6 +34,12 @@ android {
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
sourceSets.main {
jniLibs.srcDir 'libs'
assets.srcDir '../../fonts'
}
aaptOptions {
// Disable asset compression for fonts.
// Without this, text rendering will be very slow.
noCompress 'ttf'
}
externalNativeBuild {
cmake {