From 2efe85919b7466525c0e01649436f6b7021d5def Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 25 Apr 2022 10:13:48 +0200 Subject: [PATCH] Load font with application context --- .../main/java/eu/faircode/email/StyleHelper.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/StyleHelper.java b/app/src/main/java/eu/faircode/email/StyleHelper.java index 2f7996885e..ec29d83dcc 100644 --- a/app/src/main/java/eu/faircode/email/StyleHelper.java +++ b/app/src/main/java/eu/faircode/email/StyleHelper.java @@ -1009,45 +1009,45 @@ public class StyleHelper { .replace("\"", "")); if (faces.contains("fairemail")) - return ResourcesCompat.getFont(context, R.font.fantasy); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.fantasy); if (bundled_fonts) { if (faces.contains("montserrat") || faces.contains("gotham") || faces.contains("proxima nova")) - return ResourcesCompat.getFont(context, R.font.montserrat); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.montserrat); if (faces.contains("arimo") || faces.contains("arial") || faces.contains("verdana") || faces.contains("helvetica") || faces.contains("helvetica neue")) - return ResourcesCompat.getFont(context, R.font.arimo); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.arimo); if (faces.contains("tinos") || faces.contains("times") || faces.contains("times new roman")) - return ResourcesCompat.getFont(context, R.font.tinos); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.tinos); if (faces.contains("cousine") || faces.contains("courier") || faces.contains("courier new")) - return ResourcesCompat.getFont(context, R.font.cousine); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.cousine); if (faces.contains("lato") || faces.contains("carlito") || faces.contains("calibri")) - return ResourcesCompat.getFont(context, R.font.lato); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.lato); if (faces.contains("caladea") || faces.contains("cambo") || faces.contains("cambria")) - return ResourcesCompat.getFont(context, R.font.caladea); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.caladea); if (faces.contains("opendyslexic") || faces.contains("comic sans") || faces.contains("comic sans ms")) - return ResourcesCompat.getFont(context, R.font.opendyslexic); + return ResourcesCompat.getFont(context.getApplicationContext(), R.font.opendyslexic); } for (String face : faces) {