Skip to content

Commit

Permalink
Wrap fontconfig translator in a try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Dec 28, 2023
1 parent 1916a03 commit dbc01d1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.viliussutkus89.android.pdf2htmlex;

import android.content.res.AssetManager;
import android.util.Log;

import androidx.annotation.NonNull;

Expand All @@ -23,7 +24,11 @@ static void init(@NonNull AssetManager assetManager, @NonNull File cacheDir, @No

ae.extract(new File(filesDir, "share"), "pdf2htmlEX/share/fonts");

File fontconfigGeneratedXml = new File(fontsConfigDir, "system-etc-fonts-xml-translated.conf");
FontconfigTranslator.translate(fontconfigGeneratedXml);
try {
File fontconfigGeneratedXml = new File(fontsConfigDir, "system-etc-fonts-xml-translated.conf");
FontconfigTranslator.translate(fontconfigGeneratedXml);
} catch (Exception e) {
Log.e("Fontconfig", "Fontconfig translator failed: ", e);
}
}
}

0 comments on commit dbc01d1

Please sign in to comment.