Re: Debian with HiDPI / 4K displays
On 11/08/15 23:17, John Goerzen wrote:
> There are many things that seem to not handle differences in DPI. Fonts
> are just the start. What about taskbars and taskbar icons, which become
> tiny at certain DPIs? We seem to be using pixel heights in these a lot.
I think we're going in circles now, but to recap, the state-of-the-art
here seems to be the same approach as Apple's "Retina displays": the
desktop environment or runtime chooses a scaling factor (usually an
integer) for "real pixels per logical pixel", and considers most
application-requested pixel sizes to be measured in logical pixels, not
real pixels. Icon rendering, widget rendering with Cairo and so on can
use the real pixels to get sub-logical-pixel resolution, but the layout
is done in terms of logical pixels (and because the scale factor is an
integer, everything is whole-pixel-aligned, so widgets aren't blurred).
CSS has a similar approach, defining a "CSS pixel" (the px unit) to be
one or more real pixels.
I know Gtk and Qt support this; Gtk can do non-integer scale factors
(although they are probably a bad idea), Qt only does integer scale
factors. In the case of Gtk, the scale factor is exposed as a setting in
Font sizes are relative to the scale factor, so if your laptop is really
176dpi and you're using a 2x scale factor, you might set X's DPI value
to around 88 (96 might be close enough).