[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - android/lib
Jan Holesovsky (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 2 08:13:01 UTC 2020
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 50 ----------
1 file changed, 1 insertion(+), 49 deletions(-)
New commits:
commit 70254897b1e254bac3b88c9a93059080758b64cf
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Jul 1 21:05:42 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jul 2 10:12:42 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>
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97718
Tested-by: Andras Timar <andras.timar at collabora.com>
Reviewed-by: Andras Timar <andras.timar 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;
More information about the Libreoffice-commits
mailing list