Font Size and DPI

From Mandriva Community Wiki

Jump to: navigation, search


Contents

Current issues

One do not want desktop size to strictly follow physical DPI

Physical DPI is useful for things like print preview.

But in many cases, displaying 10pt fonts using 10/72*125 = 17.4 pixels on a 125 DPI display is not that important. People don't care that 1pt really is 1/72 inch. For those cases, we need a logical DPI, that allows to scale the desktop, and adapt to the different users. This logical DPI should be computed using physical DPI, but also taking into account the viewing distance. For example, desktops and laptops have different viewing distances. See Owen Taylor's comment or Federico font size selector suggestion for more.

An even better idea would be to use radians instead of pt.

Font size follow DPI, but not the rest of the desktop

Until recently GNOME/KDE desktop used:

  • non-scalable icons
  • widgets with size given in pixels
  • fonts given in points

Here is the result for high DPI:

  • font size are quite big
  • but the windows will stay the same size and text will overflow (this is a typical issue with translations that are much longer in a language than in english).
  • margins and spacing are too small. Those are expressed in pixels and have been carefully designed for a given font size. With bigger fonts, the result is ugly.
  • icons are small compared to the text

Until this is fixed (some proposals for gtk), this pleads for using a fixed logical DPI.

Solution

In Mandriva 2009.0, we force 96dpi :

Background

Xorg defaulted to 75dpi until 2008

In Mandriva, Xorg is now defaulting to 96dpi, but upstream Xorg 1.4 was still defaulting to 75dpi. Which means Xorg failing to detect the physical DPI will use a crazy default, and font size will be small on most displays.

That's why physical DPI was not used:

Gnome hardcoded 96dpi until March 2007

Personal tools