3 ms·
> Instead, macOS always uses 72 PPI to convert points to pixels. Can't displays report their physical dimensions now? Couldn't this be used to restore using a
by chrisseaton 6y ago
> Instead, macOS always uses 72 PPI to convert points to pixels.
Can't displays report their physical dimensions now? Couldn't this be used to restore using a physical dimension like mm for font sizes? (Please not inches of all things though!)
- jfk13 6y agoIt could, but would usually be misused. People would design for the size of display and typical viewing distance that they like to use, forgetting that these things vary hugely. (And that doesn't even begin to address the question of what part of the font you'd be measuring.)
- dfox 6y agoThey do and in fact both X11 and Windows are capable of using that information to scale font pixel sizes appropriately. In both cases this mostly defaults to off and fixed DPI for UI font layout because the result of non-default display DPI leads to either the result looking wrong/ugly (blurry text, thickness of font strokes disproportionate to other UI elements etc) or even unusable (there is edge case in Win32 UI where one way to create non-resizable dialog-style top-level application window causes its contents to scale with DPI, while size of the window itself does not -> you get UI elements that are cliped outside of the window).
- deleted 6y ago[deleted]
- kmeisthax 6y agomacOS already does this at the pixel step, by multiplying the entire pixel layout by a scaling term before actually drawing the widgets. So effectively, macOS does not use 72 points-per-inch, it uses 72 points-per-pixel, and then ensures 1 pixel is a particular physical measurement, for the same compatibility reasons that caused us to drop device pixels. The reason why the author is having issues with text sizes on different size monitors is that macOS does not support fractional scaling; and it's high-DPI detection is fairly limited. A non-high-DPI monitor has no scaling options whatsoever, it's locked to 1x. High-DPI monitors are locked to 2x; with the additional option to change the desktop's layout size and scale the resulting image to achieve the effect of fractional scaling. (Apple is really paranoid about introducing rounding errors in pixel-aligned layouts, which is why they handle non-integer displays this way.) BTW, if anyone happens to know how to manually flag a monitor as HiDPI in macOS Mojave (or if I can do it in Catalina/Big Sur), please let me know. I have a 1080p NexDock Touch that I have to run at 720p because macOS won't give me the fractional scaling options on an external monitor.
- armagon 6y agoI really wish I could use 1080p with a 1.5x scale factor. It is worth noting that when Apple was initially developing this feature, around the time of Mac OS 10.5 (Leopard), they had fractional scaling. I thought it was awesome. I can only assume that some artists felt it was not awesome. (I'm going to stop googling for this now, but I think 'Resolution Independence" is a key phrase that will help in finding it if you are interested). As for HiDPI mode, I know I've done it in the past for external displays, but I haven't been able to get it to work with my 1080p displays using Big Sur. I think this might've been the most useful link I've come across: https://www.reddit.com/r/hackintosh/comments/jh6pjd/hidpi_on_2560x1440_screen_big_sur/ https://www.reddit.com/r/hackintosh/comments/jh6pjd/hidpi_on... . If you do manage to get it to work, a toolbar app like ResolutionTab or EasyRes is then a big help for changing between modes.
- kmeisthax 6y agoThe reason why Apple doesn't do fractional scaling is rounding errors: if you have a design that's aligned to the pixel grid at 1x, it's only guaranteed to remain aligned to that grid if you scale by other integers. If you aren't on the pixel grid, then the layout engine has to round sizes up or down to fit, which is dangerous. You're adding error to layout and then multiplying it by the number of elements being sized. This gets particularly bad on the web, where a number of different tricks have been employed by browser vendors over the years to avoid rounding errors (see https://www.palantir.net/blog/responsive-design-s-dirty-little-secret https://www.palantir.net/blog/responsive-design-s-dirty-litt...). If you have, say, a float-column layout with percentage widths, then rounding errors can easily wind up making things either not line up or, worse, actually overflow their containers for no reason, breaking the layout. Throwing non-integer scaling into the mix makes this even worse. Of course, this is a tractable problem, but it was much easier for Apple to just render-and-downscale from the nearest whole-number factor instead of making the lives of any developer with custom layout engines that much harder.
- chrisseaton 6y agoI don't get it - why does alignment matter when pixels are so small you've got no hope of seeing if something is aligned down to such a small measurement or not?