]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
New icons, fixes to strings, trying to handle bad typeface.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index 3b01133c0f4bf999e762c3080c2365cd40ea1cac..5d937f8078a0179a1c2e26f0359eadf9211664a3 100644 (file)
@@ -251,7 +251,12 @@ public class DictionaryActivity extends ListActivity {
     if ("SYSTEM".equals(fontName)) {\r
       typeface = Typeface.DEFAULT;\r
     } else {\r
-      typeface = Typeface.createFromAsset(getAssets(), fontName);\r
+      try {\r
+        typeface = Typeface.createFromAsset(getAssets(), fontName);\r
+      } catch (Exception e) {\r
+        Log.w(LOG, "Exception trying to use typeface, using default.", e);\r
+        Toast.makeText(this, getString(R.string.fontFailure, e.getLocalizedMessage()), Toast.LENGTH_LONG).show();\r
+      }\r
     }\r
     if (typeface == null) {\r
       Log.w(LOG, "Unable to create typeface, using default.");\r