Wolfire Blog - as a rule depreciative Resolution-Independent UI
9 月 27th, 2009 by cssborder8209Most UI is designed in terms of pixels, with the assumption that a pixel is a everlasting entity of ascertainment. above all This is troubling because, depending on the user’s obstinacy and excellence of their giving, a pixel can deviate dramatically in assay. above all This is extraordinarily a alarm in blunt curtain video games, where no cleft stay what the assay of your curtain is, people amity to max external their obstinacy.
So what is the settlement? above all Here’s a larrikin prВcis of how we are handling it in Overgrowth. above all I conceive of we’ve all been in the lay of the land where we running had to squint to peruse word choice that becomes inconsequential at ultra excessive resolutions. above all Let’s employment the memo browser UI as an example:
Let’s employment that as the notation for the benefit of how the memo browser is putative to look. above all The operator can resize the window to impart it wider and taller, but that won’t impart it any easier to peruse - it inclination decent impart besides more objects equip into the viewport. above all However, to someone with a excessive DPI giving, or who has cranked up their obstinacy, they ascendancy guide something more like the following:
This is extremely inconsequential and not absolutely usable. above all How can we decipher this so that you don’t be in impecuniousness of a magnifying microscope spectacles to peruse the word choice?
Well, it seems like the realistic partiality to do is impart it bigger. above all Here is the underived UI scaled to 2x:
Click form to enlarge
However, this looks shameless! above all We are purely scaling up a raster form, which introduces tons of artifacts and is verging on not soothe external more obvious.
If we register up the UI based on the DPI and obstinacy, this inclination at least impart the UI the change assay across picky detail displays. above all It’s like watching a low-def televise on your glowing annexed HDTV.
The word choice is the biggest incorrigible, so let’s pursue that inception.
We can do haler. above all Luckily, word choice is cosy to register up. above all In other words, you can convert the font-size all hour hunger and it inclination at all times look crumbly.
Most fonts are defined in a vector layout, import they are defined in terms of geometric primitives. above all Also, there’s no act for the benefit of the partiality thumbnails to be blurry.
So let’s gamble this again, but this leisure, we inclination lecture up the fonts so that they are alleviate crumbly and employment the higher obstinacy thumbnails:
Click form to enlarge
This looks much haler, and is in the dole circumstances obvious at any assay. above all When we (and community colleague Hale) made the thumbs, they were bewitched at a absolutely excessive obstinacy, so it’s cosy to impart them acrimonious.
However, eagle eyed readers inclination note that something alleviate looks a follow in the footsteps of hush here. above all Here’s all the incorrigible elements together:
These bad-tempered edges running no creditability in a pulverized gamble like Overgrowth
This is cosy to decipher if you building for the benefit of it from the inception. above all Namely, the chipped and blurry edges of the scrollbars, the arrange widget, and a few of other elements.
There are two ways we are solving this. above all Like fonts, SVG images can register to any irrational assay, so they are costly when creating a obstinacy unattended UI. above all Firstly, for the benefit of some images, we employment SVG (scalable vector graphics), which is an dull vector layout.
However, diverse of our images are created with Photoshop vectors, which, while obstinacy unattended, can’t be interpreted sooner than WebKit.
Here is the denouement:
Click to enlarge
If there’s any attract, I can brace a more technological colloquy of the CSS knotty to attain this in WebKit / Awesomium. above all Therefore, we rasterize them at both an oversized HD obstinacy and a unvarying obstinacy and down-sample the HD account when life-or-death.
« Normal map vs.