[vlc-devel] [PATCH] draw the toolbar with DPI-aware dimensions

Rémi Denis-Courmont remi at remlab.net
Mon Nov 10 12:24:58 CET 2014

Le 2014-11-07 07:38, Jarrad Whitaker a écrit :
> Forgot to mention, the reason for the hardcoded number 96 is simply
> that this is used as our "baseline" scaling factor of 1 (so we are
> saying that the existing pixel lengths in VLC are correct for a user
> at 96 DPI, which is the case), and the user's current DPI is
> interpreted as a multiple of that; this multiple is what what we use
> to scale all our dimensions.

As far as I know, the "old" standard for monitors was 72 PPI, not 96 
PPI. 96 PPI is just the value set by Microsoft and copied by others to 
map the font size on screen and on paper. I do not believe that printing 
is very relevant to VLC though.

> The alternative to this is to write that we want all our dimensions 
> in
> some physical unit (say points or cm) and then work out the pixels
> from there. This is also perfectly valid, but given all this scaling
> is linear the results will be identical for a lot more work, and
> furthermore it would be very easy to muck up the current 
> pixel-perfect
> rendering at 96DPI with this approach.

I think a physical dimension would make a lot more sense than an 
arbitrary scale relative to old monitors. I think we can live with an 
imperial unit if it keeps things simpler.

But how do you deal with non-square pixels?

Rémi Denis-Courmont

More information about the vlc-devel mailing list