mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Fixed font size units
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user