Allow to set DPI resolution

Bug #8357 reported by Martin Pitt
74
This bug affects 12 people
Affects Status Importance Assigned to Milestone
gnome-control-center
Expired
Wishlist
gnome-control-center (Ubuntu)
Won't Fix
Wishlist
Ubuntu Desktop Bugs

Bug Description

Computer -> System Configuration -> Screen Resolution should not only allow to
set widht, height, and frequency, but also the physical resolution of the
monitor. A friend of mine got 1600x1200 as default resolution, which makes
characters far too small to be readable.

Instead of specifying a DPI number directly (which is somewhat abstract), there
should be two rulers displayed; either the user measures them with a "hardware
ruler" and enters the lengths of the displayed rulers (much like GIMP does), or
there is a slider for each direction which scale the displayed rulers until they
match the hardware ruler.

http://bugzilla.gnome.org/show_bug.cgi?id=153634: http://bugzilla.gnome.org/show_bug.cgi?id=153634

Revision history for this message
Sebastien Bacher (seb128) wrote :

you can specify the DPI in the fonts config (Computer -> Desktop Preferences ->
Fonts)

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #1)
> you can specify the DPI in the fonts config (Computer -> Desktop Preferences ->
> Fonts)

This is hidden very well, you even have to click at "Details" to see it. "Screen
resolution" is exactly the word that describes a DPI setting.

Can we reopen this bug? It's just enhancement, after all. At least the screen
resolution configuration should point to the place where you can change the DPI
setting.

Revision history for this message
Martin Pitt (pitti) wrote :

Besides, how I am supposed to find which DPI setting my monitor actually has?
Okay, I know it has 1280 Pixels, its width is about 45 cm, I know how to convert
cm to inch and how to divide two numbers. But neither do I have such a long
ruler, nor does every user know what a DPI number is.

IMHO the "show two rulers" solution is still a very good one.

This should certainly be implemented upstream; however, a small note in the
resolution dialog where to find the DPI setting would still be nice.

Revision history for this message
Sebastien Bacher (seb128) wrote :

feel free to reopen, or perhaps to add this to 1156 ?

Revision history for this message
Martin Pitt (pitti) wrote :

Reopened with Sebastien's permission.

Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
James Henstridge (jamesh) wrote :

The "Screen Resolution" control panel uses the RANDR extension, which lets you
change the resolution and rotate the screen at runtime. From a quick look at
the header file, there is nothing for setting the DPI, and this doesn't really
surprise me.

If an app wants to find out what the DPI of the screen is, they need to do the
following:
 1. ask for the height/width of the screen in pixels (using WidthOfScreen() and
HeightOfScreen() functions)
 2. ask for the height/width of the screen in millimetres (using
WidthMMOfScreen() HeightMMOfScreen())
 3. divide the width in pixels by the width in inches (converted from
millimetres). The same for height.

The physical size is either detected from the monitor, or entered manually into
the X config file. Since the X server is working with the physical size of the
screen, there is no other value to change when changing resolutions. Similarly,
for a rotation you just swap the physical screen width/height.

So I don't think it would be possible to change the server DPI through the
control panel.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #7)
> The physical size is either detected from the monitor, or entered manually into
> the X config file.

Exactly this should be set by an easy to use interface. Similar to the already
existing DPI switch in the advanced font dialog, but this is too hidden, and an
user will not know what a "DPI" is, or how to calculate it properly. That's why
I proposed to show two rulers the user can measure.

> So I don't think it would be possible to change the server DPI through the
> control panel.

It already is, it just should be done more obvious and easy.

Revision history for this message
James Henstridge (jamesh) wrote :

Ah. The DPI setting in the fonts control panel is actually separate to the X
server DPI. It will in fact default to 96dpi no matter what the X server DPI is
set to.

The reasoning for this is that the linear DPI of the screen isn't what matters
for font sizing -- it is the angular resolution. You probably want to use a
larger physical size for a "size 12 font" when using a data projector, compared
to what you would want for a monitor sitting in front of you.

So the font DPI setting is more of a setting that you'd tweak til things look
about right, rather than something where you would present an onscreen ruler to
the user and get them to measure things exactly.

Revision history for this message
Nikolaus Rath (nikratio) wrote :

If the gconf dpi key is actually just for adjusting font sizes,
it should really:

1. have a different name
2. be relative to the actual (X11) DPI value

The current situation is really bad. Wrong DPI information
breaks every WYSIWYG attempt. Using gnome on screens with
different x/y DPI is impossible.

Gnome bug 104341 has more information.

Btw: I think this should at least be severity: minor.

Revision history for this message
James Henstridge (jamesh) wrote :

The wysiwyg argument is a bit of a strawman. If an application is trying to
display exactly what you'd see on paper, it will need pretty complex font
handling no matter what Pango thinks the font DPI is. In particular, it will
want to lay things out according to the output device's metrics rather than the
screen's metrics, which can involve hinting the font outlines for one resolution
and then rendering those outlines at another resolution (fonts do not scale
linearly due to quantisation and hinting).

Now if we put aside the wysiwyg argument and look at "the size of fonts used to
draw the UI", then it is pretty clear that the physical resolution is not that
important. What is important is to make a font of size "12" look about the same
on whatever screen you are using, which means you want to callibrate the angular
resolution instead (which depends on both the physical DPI and the distance from
the screen). Unfortunately the X server can't tell us what that value is, which
is why the user can adjust it in the control panel.

Revision history for this message
Nikolaus Rath (nikratio) wrote :

> The wysiwyg argument is a bit of a strawman. If an application is trying to
[...]

I'm not an expert in this topic, so I won't try to discuss the
technical necessity. However, when reading your following statement:

> Now if we put aside the wysiwyg argument and look at "the size of fonts used to
> draw the UI", then it is pretty clear that the physical resolution is not that
> important. What is important is to make a font of size "12" look about the same
> on whatever screen you are using, which means you want to callibrate the angular
> resolution instead (which depends on both the physical DPI and the distance from
> the screen). Unfortunately the X server can't tell us what that value is, which
> is why the user can adjust it in the control panel.

..it seems obvious to me that:

a) the setting should be named something like "fontsize"
If the value is only used for drawing fonts and has no direct connection
to the physical DPI than this would be a much more descriptive name which
doesn't lead to errors like mine.

b) the setting shouldn't be absolute but rather a corrective factor for
the actual X11 DPI value.
Currently, we are asking to user for a value depending on two factors:
DPI and distance. However, we already know the DPI. This is a source for
problems. Why don't we only ask the user for the variable we don't know?

Revision history for this message
Trent Lloyd (lathiat) wrote :

as a point, the X server DPI is not always set correctly by drivers if at all.

some dodgy laptops etc report totally wrong values.

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote : Font Rendering Details with Ruler

I do agree, the DPI setting should also be accessible from Screen Resolution dialog, though that doesn't necessarily mean it needs to be removed from the Font Rendering Details dialog.

The ruler idea is great, I made some proof of concept art.

It seems 2inch or 51mm are the best sizes to use, because they match almost exactly. For example 10mm isn't accurate enough.

Maybe a small 2inch/51mm ruler could be printed on the side of the Ubuntu CD covers??

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Of course the ruler in my concert art, is (2inches * 98dpi), this means as the user changes the dpi settings the ruler should also change it's size.

Changed in control-center:
assignee: seb128 → desktop-bugs
status: Unconfirmed → Confirmed
Revision history for this message
Evan Klitzke (eklitzke2) wrote :

Actually, it is possible to have X11 autodetect the DPI of the screen. Just run the command:
  xdpyinfo | grep resolution
and you will get the correct DPI value for the monitor X is running on. I think that autodetection is a better mechanism than adding a new setting somewhere. I just filed a bug on this in the Gnome bugzilla today, and am going to add that bug to the upstream bug list; if anyone disagrees with that decision, feel free to change it :-)

Revision history for this message
Evan Klitzke (eklitzke2) wrote :

Apparently I can't file the upstream bug because one is already set. I'm going to make a note in my bug that it is related to the bug already filed, and we'll see how the Gnome devs decided to classify it.

Revision history for this message
Evan Klitzke (eklitzke2) wrote :

Sorry, for not mentioning this earlier, the bug that I filed is upstream bug 436724 (i.e. in bugzilla.gnome.org).

Revision history for this message
etteyafed (gdefayette) wrote :

Idea from post by Nikolaus Rath . Why don't we ask the user to verify/input the detected physical size of the screen at installation and automatically select a good DPI based on that and the screen resolution? The configuration options for and changing the physical size of the screen and DPI should still be easier to find though.

Changed in control-center:
status: Confirmed → Triaged
Revision history for this message
Luke Schlather (luke2760) wrote :

I'd second that. This is a major usability concern. Especially since I've turned up my dpi, and the monospace font size in firefox, and the text in this box still clocks in at roughly 2 mm per line. I don't know if maybe a more general 'provide general-purpose method to set minimum font size based on screen size' bug might be needed. With older CRT monitors this happens all the time.

Revision history for this message
Nikolaus Rath (nikratio) wrote :
Revision history for this message
Nikolaus Rath (nikratio) wrote :

Can we please set this bug to a different priority than wishlist? It might be just a missing feature in gnome-control-center, but it causes bugs in other applications which then (probably rightly) blame gnome-control-center for providing wrong dpi values (e.g. bug 387462).

I think this whole dpi issue should really be bumped up a bit in priority.

Changed in gnome-control-center:
importance: Unknown → Wishlist
Changed in gnome-control-center:
status: New → Expired
Revision history for this message
hackel (hackel) wrote :

It appears that as of Ubuntu 11.10 there is no longer ANY way to correct incorrectly detected DPI. This needs to be fixed rather urgently before 12.04 is released...

Revision history for this message
Ari (ari-lp) wrote :

The LTS version is here and this issue hasn't been fixed yet. Still no easy way to change the DPI.

Changed in gnome-control-center (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.