I am using a webview to draw html report then capture as bitmap to print on pdf.
I tried using px, rem, pt to set font size but the result are different in phone and tablet. For same font size, e.g. size=16px, phone draws smaller while tablet draws bigger.
I call GetDeviceLayoutValues.Scale, based on @Erel's example, should set font size like 30 / GetDeviceLayoutValues.Scale, then
1. phone has GetDeviceLayoutValues.Scale = 2.75, then 16/2.75 = 5.8 = 6
2. tablet has GetDeviceLayoutValues.Scale = 1.5, then 16/1.5 = 10.7 = 11
Phone draws even smaller and table draws even bigger. I tried 16 * 2.75 = 44 for phone, 16 *1.5 = 24 for tablet, both phone and table draw different font size.
So I am confused.
How could I draw consistent size of font in different devices?
I tried using px, rem, pt to set font size but the result are different in phone and tablet. For same font size, e.g. size=16px, phone draws smaller while tablet draws bigger.
I call GetDeviceLayoutValues.Scale, based on @Erel's example, should set font size like 30 / GetDeviceLayoutValues.Scale, then
1. phone has GetDeviceLayoutValues.Scale = 2.75, then 16/2.75 = 5.8 = 6
2. tablet has GetDeviceLayoutValues.Scale = 1.5, then 16/1.5 = 10.7 = 11
Phone draws even smaller and table draws even bigger. I tried 16 * 2.75 = 44 for phone, 16 *1.5 = 24 for tablet, both phone and table draw different font size.
So I am confused.
How could I draw consistent size of font in different devices?