Added relative font size support

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

@ -477,13 +477,19 @@ public class HtmlHelper {
if (!TextUtils.isEmpty(size)) { if (!TextUtils.isEmpty(size)) {
try { try {
int s = Integer.parseInt(size); if (size.startsWith("-"))
if (s < 3) size = "smaller";
size = "small"; else if (size.startsWith("+"))
else if (s > 3) size = "larger";
size = "large"; else {
else int s = Integer.parseInt(size);
size = "medium"; if (s < 3)
size = "small";
else if (s > 3)
size = "large";
else
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