[Development] Revisiting high-DPI configuration options

Randall O'Reilly randy.oreilly at Colorado.EDU
Wed Jul 27 05:21:48 CEST 2016


I migrated to Qt from InterViews: http://www.ivtools.org/ivtools/doc/refman3.1/index.html  which used floating-point units that could be arbitrarily rescaled, but default to points, like many other standards (e.g., SVG, Postscript).  I always found it strange that Qt used integer pixel coords.  Seemed like a very time-limited solution even back in the day in terms of rendering to a printer vs. a screen, and anticipated increases in screen resolution which are now (finally) happening.

Seems like it might be time to do a global replace int -> float and just fix the “standard” meaning of the coordinate system in terms of points, given that it is probably pretty close to the pixel density of the “classic” displays that Qt was developed on, and it is used in these other standards, and existing apps should probably perform reasonably well with such a definition.  But internally support an arbitrary floating-point scaling factor so people can use whatever coordinate system they want going forward.  It just seems like any other solution is going to end up being a dead-end for future displays, and rather ugly in any case (as the current solution is demonstrating).

Also, another nice thing that InterViews got right was a multi-pass layout algorithm that “just worked” to best fit elements in available display spaces — including the option of using a LaTeX-inspired layout algorithm.  You specify “natural” sizes and flexibility factors, and the algorithm optimizes from there.  This works well when moving away from having to do precise layouts in pixel coordinates.. 

- Randy

> On Jul 26, 2016, at 8:56 PM, Nikita Krupenko <krnekit at gmail.com> wrote:
> 
> 2016-07-27 4:02 GMT+03:00 Thiago Macieira <thiago.macieira at intel.com>:
>> Em quarta-feira, 27 de julho de 2016, às 02:49:31 PDT, Nikita Krupenko
>> escreveu:
>>> In Material Design guidelines [1] all font sizes are in scaleable
>>> pixels (sp). So this size could be multiplied by some factor and all
>>> fonts should scale equally.
>> 
>> Maybe we should instead use a size calculated in physical units, like 1/72th
>> of an inch. Oh, we have such a unit: points.
> 
> The idea of scaleable pixels is somewhat different: user can select
> big/small fonts in the OS/application settings and font sizes would be
> multiplied by some factor, for example 1.5.
> 
> BTW, why use font size in points? As other elements, like widgets,
> images, etc has size in pixels, it's better to use pixels for fonts
> too. Auto HiDPI scaling in Qt works for font sizes in pixels.
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list