Added relative font size support

This commit is contained in:
M66B 2021-04-19 21:22:28 +02:00
parent cb4ec62787
commit 405b7ec4d6
1 changed files with 13 additions and 7 deletions

View File

@ -477,6 +477,11 @@ public class HtmlHelper {
if (!TextUtils.isEmpty(size)) {
try {
if (size.startsWith("-"))
size = "smaller";
else if (size.startsWith("+"))
size = "larger";
else {
int s = Integer.parseInt(size);
if (s < 3)
size = "small";
@ -484,6 +489,7 @@ public class HtmlHelper {
size = "large";
else
size = "medium";
}
sb.append("font-size:").append(size).append(";");
} catch (NumberFormatException ex) {
Log.i(ex);