[Libreoffice-commits] online.git: 2 commits - android/lib
Jan Holesovsky (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 2 07:12:12 UTC 2020
android/lib/build.gradle | 11 --
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 50 ----------
2 files changed, 1 insertion(+), 60 deletions(-)
New commits:
commit 4db78707d01468f8851409eee73327b063e1254e
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Jul 1 21:05:42 2020 +0200
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jul 2 09:12:01 2020 +0200
android: No need to copy fonts from system any more.
After the update of fontconfig, the hack to not to use the Noto fonts is
not needed any more, they load quickly now.
Change-Id: Iebd2c944e9fcc04d6976002f24a3a47f0b49f2ad
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97659
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 5074d637a..8465ff5e1 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -203,54 +203,6 @@ public class LOActivity extends AppCompatActivity {
}
}
- /**
- * Copies fonts except the NotoSans from the system to our location.
- * This is necessary because the NotoSans is huge and fontconfig needs
- * ages to parse them.
- */
- private static boolean copyFonts(String fromPath, String targetDir) {
- try {
- File target = new File(targetDir);
- if (!target.exists())
- target.mkdirs();
-
- File from = new File(fromPath);
- File[] files = from.listFiles();
- for (File fontFile : files) {
- String fontFileName = fontFile.getName();
- if (!fontFileName.equals("Roboto-Regular.ttf")) {
- Log.i(TAG, "Ignored font file: " + fontFile);
- continue;
- } else {
- Log.i(TAG, "Copying font file: " + fontFile);
- }
-
- // copy the font file over
- InputStream in = new FileInputStream(fontFile);
- try {
- OutputStream out = new FileOutputStream(targetDir + "/" + fontFile.getName());
- try {
- byte[] buffer = new byte[4096];
- int len;
- while ((len = in.read(buffer)) > 0) {
- out.write(buffer, 0, len);
- }
- } finally {
- out.close();
- }
- } finally {
- in.close();
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- Log.e(TAG, "copyFonts failed: " + e.getMessage());
- return false;
- }
-
- return true;
- }
-
private Handler getMainHandler() {
if (mMainHandler == null) {
mMainHandler = new Handler(getMainLooper());
@@ -289,7 +241,7 @@ public class LOActivity extends AppCompatActivity {
@Override
protected Void doInBackground(Void... voids) {
// copy the new assets
- if (copyFromAssets(getAssets(), "unpack", getApplicationInfo().dataDir) && copyFonts("/system/fonts", getApplicationInfo().dataDir + "/user/fonts")) {
+ if (copyFromAssets(getAssets(), "unpack", getApplicationInfo().dataDir)) {
sPrefs.edit().putString(ASSETS_EXTRACTED_GIT_COMMIT, BuildConfig.GIT_COMMIT).apply();
}
return null;
commit 0a3df76ff4cfbb45017f9264c7b681898df3bb8d
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Jul 1 20:41:41 2020 +0200
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jul 2 09:11:53 2020 +0200
android: Use the system fonts.
Now that we have upgraded the fontconfig to a version that can process
the Noto fonts in reasonable time, use them.
Change-Id: I7e46bef6827f5e257a0d583137aa9a26c2a22ed3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97658
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index c3b3621b9..8882d8e5d 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -117,17 +117,6 @@ task copyUnpackAssets(type: Copy) {
String line ->
line.replaceAll(
'@@APPLICATION_ID@@', new String("${liboApplicationId}")
- ).replaceAll(
- // FIXME Avoid the Android system fonts for the moment,
- // the huge Noto Sans fonts have terrible impact on the 1st
- // start performance.
- // The real solution would be to either make fontconfig
- // faster, or at least find a way to avoid only the Noto
- // Sans, or present a progressbar or something.
- // For the moment, we just copy the Roboto font (needed
- // for the dialogs; see LOActivity.copyFonts()) and
- // remove the system fonts from the config.
- '<dir>/system/fonts</dir>', new String("")
)
}
}
More information about the Libreoffice-commits
mailing list