Death to px, long live ch
71–80 of 86 posts
Re: Death to px, long live ch
#72The article links to https://shkspr.mobi/blog/2018/11/the-myth-of-the-pixel-perfe... which confuses me, because I definitely remember pixels being visible when I was growing up. I remember the first time I got a 1080p monitor. I felt a visceral terror at the fact that I could no longer see the pixels.
Re: Death to px, long live ch
#73The article links to https://shkspr.mobi/blog/2018/11/the-myth-of-the-pixel-perfe... which confuses me, because I definitely remember pixels being visible when I was growing up. I remember the first time I got a 1080p monitor. I felt a visceral terror at the fact that I could no longer see the pixels.
Yeah, you can see square-looking pixels on most screens if you display something with sharp aliasing. "There is no universal grid" is good to understand, but there are device-specific grids all over the place. And all the examples that are ultra zoomed and/or showing antialiased font rendering obscure the pixels that are more visible in other situations. That 0.01 to 0.04 degree range later in the article is big enou…
That's part of what led to dithering being as much or more important than exact color matching. That's also what led to advances at the time in sub-pixel anti-aliasing such as the earliest forms of Microsoft's ClearType brand which blended neighboring colors to make perceptually cleaner font rendering.
As we've moved to solid state hardware the grid didn't get more exact, and sub-pixels became even more interesting, rather than less. Most LED displays are triangular shapes, not square grids, with red/green/blue LED diodes packed closely together to map a virtual pixel. (To my understanding some LED displays get even more complex with hexagonal or octagonal packing.)
The device-specific grids even more rarely today reflect what we would expect of a "square" pixel grid. (Or even a 4:3 rectangular grid.)
Square cartesian grids are easy to program with it. It's always been a useful abstraction, even in the CRT era. It's easy to forget that it was always an abstraction. Ultra zoom operates on the abstraction, not the physical reality. It explodes a cartesian grid, because that's mathematically easy (and the useful abstraction we like to program with).
(All of that is before you get to things like OSes and Browsers gave up on mapping the virtual pixel cartesian grids to physical "pixel" grids in real life because the "pixels" became too small, so most users see "16px" fonts as 125-175% expansion to keep fonts readable without magnifying glasses. Web Browsers have "lied" about the physical size of pixels since roughly the end of the CRT era and browser pixels are font-relative too, in which case the other font-relative measurements are often more useful simply for being "honest". Nobody really wants "pixel perfect" accuracy in websites, not even the designers that pride themselves on it and think it matters more than other characteristics like responsive adaptability to device type.)
Re: Death to px, long live ch
#74Earlier quoted context omitted.
Yeah, you can see square-looking pixels on most screens if you display something with sharp aliasing. "There is no universal grid" is good to understand, but there are device-specific grids all over the place. And all the examples that are ultra zoomed and/or showing antialiased font rendering obscure the pixels that are more visible in other situations. That 0.01 to 0.04 degree range later in the article is big enou…
It never says 0.04 degrees, just 0.04mm (corresponding to about 0.015 degrees at the stated 15cm distance).
In that case let's look at what reaching .01 degrees means for a desktop. At normal viewing distance, a 20 inch screen needs to be 4k, and a 30 inch screen needs to be 6k. Very few desktops reach the level where pixels are mostly hidden.
Re: Death to px, long live ch
#75Earlier quoted context omitted.
Nobody uses ch, let's be honest.
Until design tools like figma use these other units, people will be stuck to rems and pixels.
(The difference between rem and em is "root", ie, only using the top-most font size and sometimes the font-size before things like zoom and other similar adjustments. If a designer complains about the `r`s you removed, sometimes just showing them the difference at multiple zoom levels is convincing enough.)
(The difference between em and ch is em is wider. If a designer is always giving you weird decimals like 0.79em or 1.24em that may be an indicator that they themselves would be happier working and thinking in ch. em is the width of the capital M which is often the widest letter in most latin sections of fonts. ch is the width of the number 0 which is often the most "typical" width in the latin sections of fonts.)
(ETA: Both of which relate to the comment above complaining that both ch/em and others fall apart when dealing with non-latin scripts, because they are established as latin-centric.)
Re: Death to px, long live ch
#76What happened to em?
That's what I wondered. I found the spec*. I'd vaguely thought that 1em was the width of "M" but apparently it's just the font-size, and the connection between font-size and the actual size of the text is very font dependent. So 1ch is defined to be the advance width of "0" (zero), so it's actually telling you something about the current font. * https://www.w3.org/TR/css-values-4/#font-relative-lengths
Re: Death to px, long live ch
#77I’d like to hear the author’s approach to vw and vh units. I’ve tended to use these units where I want a specific feel and it’s worked relatively well over the years. I’m surprised it was not mentioned given the justifying of ch was around the desire of a consistent layout.
Re: Death to px, long live ch
#78Earlier quoted context omitted.
Yeah, you can see square-looking pixels on most screens if you display something with sharp aliasing. "There is no universal grid" is good to understand, but there are device-specific grids all over the place. And all the examples that are ultra zoomed and/or showing antialiased font rendering obscure the pixels that are more visible in other situations. That 0.01 to 0.04 degree range later in the article is big enou…
Ultra zoom approximates a pixel grid, but the pixel grid it approximates no longer exists (and arguably never physically existed, it was always a mapping scheme). We tend to think of pixels as square bricks, but even in the CRT era they were closer to 4:3 rectangles than squares, and that too was an approximation because phosphor beams were a fairly analog technology and hitting a square (or rectangle) grid was an im…
Square pixels are the most real on LCD, and most desktops are still LCD.
Also when I said ultra zoom there I meant the actual photos showing enormous pixels.
> Nobody really wants "pixel perfect" accuracy in websites,
As long as you're keeping the scaling correct, snapping to the nearest pixel is sometimes useful. I don't know if it counts as a "website" but I've coded webgl shaders that adjust to the real device pixels and look much better for it.
125-175 percent expansion also happens to be the range where being pixel-aware can give you the most benefit. Fonts look good at those sizes because the browser can render at the final resolution instead of scaling afterwards. (Except when macOS renders at 2x and scales it down so everything is blurry)
Re: Death to px, long live ch
#79I also did some experiment with ch many years ago. I found that 60ch is ideal width for block text for easy reading. too bad it is pretty hard to make websites with only 60ch wide.
Huh? Your content What is hard about that?
typically 60ch equal to 480px (font size 16px), so you need sidebars to the left and the right. which is fine, the holy grail was like that. but if you want to design a layout that look good in all screen resolutions, then a fixed layout does not work. you would have a dozen compromises and layout switches to make it work. at that point, forcing a block to have at max 60ch is painful.
and, if you do the main + sidebar layout, with maximum width for the whole site is around 960px (or 1200px if you have multiple sidebars) then suddenly you do not need to think about 60ch width anymore, because it naturally just fits (except for some width points)
Re: Death to px, long live ch
#80Earlier quoted context omitted.
Huh? Your content What is hard about that?
what hard is making a fully featured website, with panels no wider than 60ch. typically 60ch equal to 480px (font size 16px), so you need sidebars to the left and the right. which is fine, the holy grail was like that. but if you want to design a layout that look good in all screen resolutions, then a fixed layout does not work. you would have a dozen compromises and layout switches to make it work. at that point, fo…
This is really not that hard nowadays. How to do responsive design is no black magic and can be done with only HTML and CSS.
You basically just need to wrap (no pun intended) your head around a few basics. Especially CSS grid templates combined with media queries allow you to rearrange the whole page depending on the screen width in a simple way, especially compared to how we had to do this 20 years ago.
You write your website semantically (or ensure the template produces semantic HTML) and then you write the CSS with realtime preview right there in the browser.