Simplification in the formula of the font size
This commit is contained in:
parent
5ea0bacddd
commit
5678f33aef
@ -342,10 +342,10 @@ RTWindow *create_rt_window()
|
|||||||
|
|
||||||
|
|
||||||
if (isPix) {
|
if (isPix) {
|
||||||
// 1pt = 0.3527mm @ 96 ppi
|
// 1pt = 1/72in @ 96 ppi
|
||||||
double resolution = style->get_screen()->get_resolution();
|
double resolution = style->get_screen()->get_resolution();
|
||||||
// px >inch >mm >pt >"scaled pt"
|
// px >inch >pt >"scaled pt"
|
||||||
int pt = (int)(fontSize / 96. * 25.4 / 0.3527 * (96. / resolution) + 0.49);
|
int pt = (int)(fontSize / 96. * 72 * (96. / resolution) + 0.49);
|
||||||
// if resolution is lower than 192ppi, we're supposing that it's already expressed in a scale==1 scenario
|
// if resolution is lower than 192ppi, we're supposing that it's already expressed in a scale==1 scenario
|
||||||
if (resolution >= 192) {
|
if (resolution >= 192) {
|
||||||
// it's already scaled up, no need to set the font size
|
// it's already scaled up, no need to set the font size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user