From 405b7ec4d6aaa870ee06e1315337e19204d85093 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 19 Apr 2021 21:22:28 +0200 Subject: [PATCH] Added relative font size support --- .../java/eu/faircode/email/HtmlHelper.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index d48c57fd40..1c84f34f22 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -477,13 +477,19 @@ public class HtmlHelper { if (!TextUtils.isEmpty(size)) { try { - int s = Integer.parseInt(size); - if (s < 3) - size = "small"; - else if (s > 3) - size = "large"; - else - size = "medium"; + if (size.startsWith("-")) + size = "smaller"; + else if (size.startsWith("+")) + size = "larger"; + else { + int s = Integer.parseInt(size); + if (s < 3) + size = "small"; + else if (s > 3) + size = "large"; + else + size = "medium"; + } sb.append("font-size:").append(size).append(";"); } catch (NumberFormatException ex) { Log.i(ex);