API request: text / UI scale factor (DPI / UI user-preferences for scaling)
See original GitHub issueMany Android devices have different DPI, and on top of this, in later Android versions (at least 7+
) it is possible to change the size of text elements in all apps.
However, when not using the Android toolkit but e.g. SDL2 (which at least appears to not support the DPI querying for Android - unless I’m wrong), there is currently no obvious way to get a plain pixel scaler (e.g. 2.0x
for a 144 DPI 4K screen with 1.0x custom UI scaling on top) which boils all this information down in a useful way.
Therefore, I propose to add an API to do the following:
- List all screens with all pixel dimensions or
None
if the API is not implemented for the given platform - Get a incorporates-DPI-user-ui-scaling-and-everything scaler for each screen (should be float, not int!!), or
None
if not known
On Android, it would of course only list a single screen usually, but on desktop it is common to have multiple screens with different DPI, so if it’s ever implemented there this screen distinction is somewhat important.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
In Gnome 3 I don’t think so, and on Windows I don’t know - but as I said above, I would expect that eventually an OS might offer this in the future, so I think it’d be wise to assume it could be the case, even if no OS makes practical use of this.
Windows and Linux didn’t support this for a long time (Linux still doesn’t unless you use the new Wayland I think), so yeah, many older applications just don’t handle this properly. But it’d be nice to be able to do so with plyer!
Oh, ok, I didn’t know it’s allowed to have different DPI scaling per monitor. In that case, sure, let’s keep it per the device itself. Does it also include text scaling (
Set custom text size (DPI)
on Windows) the same way per monitor?