Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.


  • To allow all visual elements (not just fonts) to scale according to screen DPI
  • To allow the user to choose their own balance between clarity and screen space, by introducing a user-configurable unit of visual element sizing, the "display unit".


This proposal aims to achieve a reasonable level of display device resolution independence without complicating the windowing system and graphics drivers. As X11 relies on integer pixel dimensions and coordinates for sizing and event processing, etc., every size that ends up in X11 is ultimately represented in pixels.

Therefore, what is outlined will not create a "zoom-safe" user interface -- the actual sizes of elements will not scale exactly linearly, but the effect will be close enough for our purposes.

Use cases

  • Zoe has a 120 DPI display. Rather than scaling up the pixel sizes of all visual elements, only fonts are correctly sized, leaving everything out of proportion and very unsightly. Zoe simply overrides her screen DPI setting, setting it to 96 to achieve the "correct" proportionality.
  • Yvonne has a 12" laptop screen, and would like to make more use of her screen space. She has set her default font size to 8 pt, but her System → Preferences menu is still far too big because the icons remain the same size.


The sizes of visual elements are specified in terms of:

  • "Device Units" (i.e. pixels) when you are interested in exact pixel sizing on a specific display device;
  • "Physical Units" (e.g. millimetre or point) when interested in a real-world likeness-for-likeness; and
  • "Display Units" (DU) in all other circumstances.

DU size is specified in terms of points (1 pt = 1/72 inch) and is applicable per screen. This value is stored in GConf, under the key (in the case of the default setup for screen 0) "/desktop/gnome/screen/default/0/display_unit". The default value is 1.0 (i.e. 1.0 pt).


Visual elements are sized accordingly:


Size (DU)

Size (pixel) @ 96 DPI, DU = 1 pt



13 1/3

Menu icons



Toolbar icons



File icons



These sizes were specifically chosen to match what is currently perceived by our user base to give the "correct" proportionality between UI elements. For a 96 DPI screen with the default DU sizing of 1 pt, these values translate directly to the exact pixel sizes we use currently.


Have GTK listen to changes in both the screen DPI and the user-specified DU size (in points). For every change, calculate a new DU size (in terms of screen pixels) like so:

inch_pixel_size = screen_dpi
point_pixel_size = screen_dpi / 72
du_pixel_size = du_point_size * point_pixel_size

This "du_pixel_size" value should be stored in memory (to save unnecessary recalculations of this ratio) and used whenever a pixel size is required:

size_in_pixel = size_in_du * du_pixel_size

Appropriate integer rounding must take place when, for example, sizing X Windows or GTK Widgets.

Fixed point arithmetic should be used to ensure maximum compatibility and accuracy.

ResolutionIndependence (last edited 2008-08-06 16:21:40 by localhost)