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 <[email protected]> AuthorDate: Wed Jul 1 21:05:42 2020 +0200 Commit: Andras Timar <[email protected]> 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 <[email protected]> Reviewed-by: Jan Holesovsky <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97718 Tested-by: Andras Timar <[email protected]> Reviewed-by: Andras Timar <[email protected]> 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; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
