diff options
author | Jan Holesovsky <kendy@collabora.com> | 2019-02-15 16:01:55 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-10-09 10:37:51 +0200 |
commit | 695a6629aa258556dd1632448753cc2ccd8ae1b3 (patch) | |
tree | ce214b045d054369803ba13fffc60d91e6772020 /sal | |
parent | e7fe5ad0a972bf9b4a629ad117e23f1a30f45d89 (diff) |
android: Set the FONTCONFIG_FILE envvar to the fonts.conf (if exists).
Change-Id: Ic9fd97a2ff8a6d96ffcc7ad300ef30201d786528
Reviewed-on: https://gerrit.libreoffice.org/67876
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/80270
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/android/libreofficekit-jni.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c index abbf3edaed10..c11f7dd4eb09 100644 --- a/sal/android/libreofficekit-jni.c +++ b/sal/android/libreofficekit-jni.c @@ -74,6 +74,9 @@ jboolean libreofficekit_initialize(JNIEnv* env, const char *cacheDirPath; const char *apkFilePath; + const char *fontsConf = "/etc/fonts/fonts.conf"; + char *fontsConfPath; + setenv("OOO_DISABLE_RECOVERY", "1", 1); native_asset_manager = AAssetManager_fromJava(env, assetManager); @@ -89,6 +92,18 @@ jboolean libreofficekit_initialize(JNIEnv* env, // TMPDIR is used by osl_getTempDirURL() setenv("TMPDIR", cache_dir, 1); + fontsConfPath = malloc(strlen(data_dir) + sizeof(fontsConf)); + strcpy(fontsConfPath, data_dir); + strcat(fontsConfPath, fontsConf); + + fd = open(fontsConfPath, O_RDONLY); + if (fd != -1) { + close(fd); + LOGI("Setting FONTCONFIG_FILE to %s", fontsConfPath); + setenv("FONTCONFIG_FILE", fontsConfPath, 1); + } + free(fontsConfPath); + apkFilePath = (*env)->GetStringUTFChars(env, apkFile, NULL); fd = open(apkFilePath, O_RDONLY); |