mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Fixed font size units
This commit is contained in:
parent
526f6b66ff
commit
5ce29f16d7
1 changed files with 4 additions and 2 deletions
|
@ -1375,9 +1375,11 @@ public class HtmlHelper {
|
|||
if (value.endsWith("pc")) // 6 pc = 72 pt
|
||||
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) / 12 / DEFAULT_FONT_SIZE_PT;
|
||||
if (value.endsWith("cm")) // 1 inch = 2.54 cm
|
||||
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) / 2.54f / 72 / DEFAULT_FONT_SIZE_PT;
|
||||
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) / 2.54f * 72 / DEFAULT_FONT_SIZE_PT;
|
||||
if (value.endsWith("mm")) // 1 inch = 25.4 mm
|
||||
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) / 25.4f * 72 / DEFAULT_FONT_SIZE_PT;
|
||||
if (value.endsWith("in")) // 1 inch = 72pt
|
||||
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) / 72 / DEFAULT_FONT_SIZE_PT;
|
||||
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) * 72 / DEFAULT_FONT_SIZE_PT;
|
||||
return Float.parseFloat(value.trim()) / DEFAULT_FONT_SIZE;
|
||||
} catch (NumberFormatException ex) {
|
||||
Log.i(ex);
|
||||
|
|
Loading…
Reference in a new issue