Skip to content

output: automatically compute scaling factor

Arnaud Ferraris requested to merge a-wai/phoc:auto-scaling into master

phoc currently defaults to unity scaling, unless the corresponding output configuration contains a scale value. Whenever the physical size of the output is available, we could actually calculate this value in order to reach the best apparent DPI. This will allow distributions to get rid of device-specific config files.

This gives good results in the following cases (tested on all devices I had on hand):

Device Mode Hor. DPI Vert. DPI Scale
OnePlus 6 1080 x 2280 403.418 399.393 3
Poco F1 1080 x 2246 403.418 419.473 3
PinePhone 720 x 1440 268.941 268.941 2
Librem 5 720 x 1440 281.354 281.354 2
PineTab 800 x 1280 150.518 149.825 1
Surf Pro 3 2160 x 1440 219.456 215.153 2
Surf Go 2 1920 x 1080 221.673 216.747 2
Nexdock 360 1920 x 1080 168.166 161.365 1
STM32 dev board 480 x 800 236.279 234.462 1.25

Merge request reports