The future looks very small.

I have a new toy. I didn’t get it because I’m hip, although I am, I got it because we’re trying to prepare Unity 7 on the Trusty Tahr (Ubuntu 14.04 LTS) for the next generation of hardware that will be sitting on everyone’s desk (or lap, or table in the coffee shop) within a few years. I got a laptop with a high-DPI (dots per inch) 4K display and a sensitive touchscreen.

This particular piece of furniture is a Lenovo Yoga 2 Pro, sporting a 3200×1800 pixel 10-touch touchscreen in a 13 inch form factor. That works out to a pixel density of about 280 pixels per inch, much more refined than my main laptop (a Lenovo ThinkPad T410, 1440×900 at 14 inches) which sits at 120 pixels per inch and the external monitor I have attached to it (a Benq FP22W, 1680×1050 at 22 inches) at 95 pixels per inch. Sure, spec ennui, but it’s germane to the topic here.

The problem is that out of the box, most GUI software assumes it’s running on a display device, regardless of its dimensions, with a dot pitch of 96 dots per inch. It’s true for Microsoft Windows and it’s true for GNU/Linux, although I’ve been out of the Apple Macintosh world long enough to plead ignorance there. I know it’s true of Microsoft Windows because the Yoga 2 Pro came with Microsoft Windows 8.1 preinstalled by the manufacturer, and I had a brief chance to test it out before I got to work. IE displayed web pages in teeny weeny characters, and when I opened COMMAND.COM (or whatever the name of the command console is these days) to create a rescue image, it defaulted to using 8×8 bitmapped fonts. The eyestrain finding the reconfiguration option felt like it caused my corneas to bleed.

We have the same problem in Ubuntu. When I installed a prelease image of Trusty on the Yoga 2 Pro the GRUB2 menu was so tiny I couldn’t read it (bitmapped fonts again). Fortunately, the default was sensible and the system booted OK. Unity 7, of course, was similarly unusable, as was the Terminal, the Browser, and pretty much everything else. Ouch.

The problem is rooted in the fact that it’s an invalid assumption that all display devices have a dot pitch of 96 pixels per inch. I already experience this with my dual monitor setup, but it’s less noticeable with 120 vs. 95 DPI. This is just not a valid assumption.

See, a character in a 12 point font needs to appear to be 12 points. That’s 1 pica. One sixth of an inch. The size of a 12 point character should not vary depending on the resolution of your monitor. There’s a caveat, though, in that when I said ‘appear’ what I meant was at a comfortable viewing distance. Turns out that for the best human interface we do in fact want the absolute size of text to change depending on the viewing distance so that there is a constant angle subtended by the display. Er, that means things that are father away need to be bigger so they seem the same size. Got it? Think: projectors. Turns out people use phones and tablets up close, so smaller is OK, but they use their laptops and desktops farther away so smaller is no good.

This is where I need a diagram as a visual aid, but I’m afraid my drawing skills have rusted out and are at the shop for repairs. If someone wants to contribute one, that’d be great.

So, what we need to do for Unity running on the desktop is to figure out the physical dot pitch for each physical display connected to the system, and calcluate the scaling factor that would convert to a fixed 96 pixels per inch, then scale the fonts by that much. Other metrics need to be expressed in terms of ems (another measure based on the current font size — a term that comes from the days of hot metal) and graphics scaled accordingly.

But wait, we don’t want to scale windows if we don’t have to. We don’t want to waste the “retina” display, we just want text to be readable (and controls to be usable). At this point, we’re looking at making sure the Unity Launcher, the Unity panel, the Quicklists, and the Shortcuts are all usable out of the box on a high DPI display, because I have one and I tell you it’s not too usable right now.

A lot of applications are not going to work perfectly on high DPI, including the browsers and the office suites. We’re thinking of adding some optional window scaling through Compiz to help out with those but time is rapidly flowing and there’s a lot of work to do. Stand by for updates. As always, patches are welcome.

About these ads

12 thoughts on “The future looks very small.

  1. Did you have issues with Nautilus? Doesn’t seem to pick up the font scaling? Most things work to a degree but can work out how to fix Nautilus on my Yoga Pro 2, any ideas?

  2. Pingback: Olli's random thoughts and impressions » Blog Archive » Unity 8 on Ubuntu 14.04

  3. I’ve recently bought a dell M3800 with a similar 3200×1800 panel – albeit a couple of inches bigger. I’m running Saucy on it, and I have to say it’s fantastic….

    Let me back up a bit. I’ve got 20/20 vision, I work at my laptop all day long, and I like really tiny text. Really really tiny text. I suppose more truthfully, I like seeing lots of text on my screen at once – many windows, devlopment environments, email, database explorers, web browsers; lots of stuff open at the same time, side by side. Tiny text, window chrome and widgets lets me do that.

    My previous laptop was a 15″ 1920×1600 and I’ve been pineing for something with better, smaller text for years, particularly as window chrome over the period has been getting bigger.

    I know not everyone shares my joy of small text on a high DPI screen, but please don’t ruin my very expensive panel by sending me back to the land of finger sized fonts.

    I’m all in favour of scallable displays, and making sure the default is easy to use, just give me an easy sliding scale that gets me back to the tiny text I adore. Pretty please?

  4. I enjoyed your article very much because I have been contemplating buying the Lenovo Yoga 2 for some time. I’m very interested to know how well it runs (especially wifi which has no dual band).

    So far we could seamlessly scale fonts on the desktop with the slider in Gnome advanced settings (whereas on Windows, I usually had to insert the install CD and login again), however not all icons and lines scaled (because it was not true ppi scaling). But in general it appeared to me that most applications nicely adhere to whatever the system theme and settings dictate.

    How bad are the issues really to transition Linux applications (compared on how other platforms handle the transition), do you think with scaling at the window manager level all legacy software will stay usable?

    • I had problems with the WiFi at first until I blacklisted the ideapad_laptop kernel module in /etc/modprobe.d/blacklist.conf — something a little beyond what most neophyte Linux users would want to do. The performance seems OK, but I haven’t tried streaming video. Running apt-get upgrade is very fast though, probably due more to the SSD than network speeds.

      I used gnome-tweak-tool to adjust the global font scaling factor and managed to get readable text in many applications, but window decorations aren’t scaling right so we have some work to do there. Not all applications use the system font or the GTK configuration settings either. Finally, the GTK configuration settings are global, and font scaling needs to be done on a display-specific basis otherwise it’s useless in a multi-monitor or attached projector configuration.

      I think we’re going to have a lot of problems with GNU/Linux applications transitioning to modern display technology because of the wide variety of toolkits used in the bazaar that is our milieue. Microsoft Windows and Apple Mac OS X applications tend to be written using the framework dictated by their platform vendor and as a result can benefit from centrally pushed changes. Having the window manager scale selected windows should go a long way towards making stuff written 20 years ago using, say, Motif continue to be usable. Not perfect, but usable.

  5. Pingback: Stephen M. Webb: The future looks very small. | Hi-tech news

  6. I’m in the same boat with Saucy here. I recently got the new ASUS Zenbook UX301LA (known pre-launch as the “Zenbook Infinity”) with a 13.3″ 2560×1440 QHD touchscreen. It is exactly 4 times the resolution of a 720p display and ASUS describes this as “3K”, although that seems like a bit of a stretch by their marketing department. (Incidentally I believe your Yoga 2 Pro’s QHD+ display would also qualify as 3K instead of 4K, since I don’t see any display on the market — UltraHD TVs included — that are referred to as 4K but have anything less than 3840 horizontal pixels.)

    After nuking the preloaded Windows 8 and installing Saucy my eyes were practically popping out of their sockets trying to read 96 DPI text rendered on the 220 DPI display. Until Unity, GTK+, and Qt are all HiDPI-ready on the desktop, I’ve managed to dial in some settings to work around the problem for the most part; Unity’s dash, menubar, and window decorations are still tiny however.

    * To enlarge fonts in general I used Unity Tweak Tool to set “Appearance > Fonts > Text scaling factor” to 1.60. Anything higher than this caused some applications like System Settings to chop off text overflowing its allotted label area.

    * I also used Unity Tweak Tool to double the size of the mouse cursor by enabling “Use large cursors” under “Appearance > Cursors”. This setting seems to take effect in most GTK+-based apps, but is ignored in Qt apps and when hovering over Unity’s own UI elements.

    * Firefox 26 has the best HiDPI support on Ubuntu I’ve encountered so far. In “about:config” I set “layout.css.devPixelsPerPx” to 2, which doubles the size of the UI elements, and “layout.css.dpi” to 192, which is twice the standard 96 DPI and doubles the size of the text to something quite readable, albeit still not-pica-accurate.

    * Sadly Chromium 31 has some HiDPI settings under “chrome://flags” but they’re grayed out. (Perhaps they’re accessible in Chrome?) All I do for now is double the text sizes in the global Chromium settings and zoom pages to 200%. The UI is still tiny, but I don’t use Chromium much anyhow.

    • One problem with individual applications carrying their own fix is that when I drag a window between monitors with different pixel densities everything breaks down. I’d really like a system-wide fix, but the reality that isn’t going to happen. Not this year, I’m afraid.

      • Out of necessity I’m up for testing HiDPI patches for anything, whether system-wide or app-specific. I’m even willing to go ahead and upgrade to Trusty if need be. This seems like an area where Ubuntu could really take the lead in distro land.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s