Added relative font size support

pull/198/head
M66B 4 years ago
parent cb4ec62787
commit 405b7ec4d6

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

Loading…
Cancel
Save