From 7250ce175a28281740008f1ce916fd98a113be79 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 20 Feb 2024 12:02:44 +0100 Subject: [PATCH] Font size for headers --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index f31f9a0ba2..305ed6cc93 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -3730,8 +3730,14 @@ public class HtmlHelper { case "h4": case "h5": case "h6": - // Font size is already set setSpan(ssb, new StyleSpan(Typeface.BOLD), start, ssb.length()); + int hsize = tag.charAt(1) - '0'; + if (hsize == 1) + setSpan(ssb, new RelativeSizeSpan(FONT_XLARGE), start, ssb.length()); + else if (hsize == 2) + setSpan(ssb, new RelativeSizeSpan(FONT_LARGE), start, ssb.length()); + else if (hsize > 3) + setSpan(ssb, new RelativeSizeSpan(FONT_SMALL), start, ssb.length()); break; case "hr": // Suppress successive lines