mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 14:51:30 +11:00
Refine DPI docs
This commit is contained in:
parent
9b122c3804
commit
a1b8d265d0
13
src/dpi.rs
13
src/dpi.rs
|
@ -28,14 +28,10 @@
|
||||||
//! for example, a button that's normally 50 pixels across would be 100 pixels across on a device
|
//! for example, a button that's normally 50 pixels across would be 100 pixels across on a device
|
||||||
//! with a scale factor of `2.0`, or 75 pixels across with a scale factor of `1.5`.
|
//! with a scale factor of `2.0`, or 75 pixels across with a scale factor of `1.5`.
|
||||||
//!
|
//!
|
||||||
//! The scale factor correlates with, but no has direct relationship to, the screen's actual DPI
|
//! Many UI systems, such as CSS, expose DPI-dependent units like [points] or [picas]. That's
|
||||||
//! (dots per inch). Operating systems used to define the scale factor in terms of the screen's
|
//! usually a mistake, since there's no consistent mapping between the scale factor and the screen's
|
||||||
//! approximate DPI (at the time, 72 pixels per inch), but [Microsoft decided to report that the DPI
|
//! actual DPI. Unless you're printing to a physical medium, you should work in scaled pixels rather
|
||||||
//! was roughly 1/3 bigger than the screen's actual DPI (so, 96 pixels per inch) in order to make
|
//! than any DPI-dependent units.
|
||||||
//! text more legible][microsoft_dpi]. As a result, the exact DPI as defined by the OS doesn't carry
|
|
||||||
//! a whole lot of weight when designing cross-platform UIs. Scaled pixels should generally be used
|
|
||||||
//! as the base unit for on-screen UI measurement, instead of DPI-dependent units such as
|
|
||||||
//! [points][points] or [picas][picas].
|
|
||||||
//!
|
//!
|
||||||
//! ### Position and Size types
|
//! ### Position and Size types
|
||||||
//!
|
//!
|
||||||
|
@ -94,7 +90,6 @@
|
||||||
//! device, and range from `1.0` to `4.0`. See [this article][android_1] for more information.
|
//! device, and range from `1.0` to `4.0`. See [this article][android_1] for more information.
|
||||||
//! - **Web:** The scale factor is the ratio between CSS pixels and the physical device pixels.
|
//! - **Web:** The scale factor is the ratio between CSS pixels and the physical device pixels.
|
||||||
//!
|
//!
|
||||||
//! [microsoft_dpi]: https://blogs.msdn.microsoft.com/fontblog/2005/11/08/where-does-96-dpi-come-from-in-windows/
|
|
||||||
//! [points]: https://en.wikipedia.org/wiki/Point_(typography)
|
//! [points]: https://en.wikipedia.org/wiki/Point_(typography)
|
||||||
//! [picas]: https://en.wikipedia.org/wiki/Pica_(typography)
|
//! [picas]: https://en.wikipedia.org/wiki/Pica_(typography)
|
||||||
//! [windows_1]: https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows
|
//! [windows_1]: https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows
|
||||||
|
|
Loading…
Reference in a new issue