From 8f3b8586b097ac7e979b6a993ea0e71f2a39d35e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 9 Mar 2021 20:37:14 -0800 Subject: [PATCH] docs: changelog for https://github.com/wez/wezterm/issues/515 closes: https://github.com/wez/wezterm/issues/515 closes: https://github.com/wez/wezterm/issues/523 --- docs/changelog.md | 1 + docs/config/fonts.md | 12 +++++----- docs/config/lua/config/dpi.md | 42 +++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 docs/config/lua/config/dpi.md diff --git a/docs/changelog.md b/docs/changelog.md index 7619d2c27..526f90cfc 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -44,6 +44,7 @@ brief notes about them may accumulate here. * New: we now bundle [PowerlineExtraSymbols](https://github.com/ryanoasis/powerline-extra-symbols) as a built-in fallback font, so that you can use powerline glyphs with any font without patching the font. * Windows: fix the unexpected default behavior of Ctrl-Alt being converted to AltGr for layouts supporting this key, the previous behavior is still possible by enabling the option [`treat_left_ctrlalt_as_altgr`](config/lua/config/treat_left_ctrlalt_as_altgr.md) (to solve [#392](https://github.com/wez/wezterm/issues/392)). Thanks to [@bew](https://github.com/bew)! [#512](https://github.com/wez/wezterm/pull/512) * X11: fix an issue where SHIFT-Enter was not recognized [#516](https://github.com/wez/wezterm/issues/516) +* X11: improved DPI detection DPI for high DPI displays. [#515](https://github.com/wez/wezterm/issues/515) ### 20210203-095643-70a364eb diff --git a/docs/config/fonts.md b/docs/config/fonts.md index 4916bf7c3..3971d19b6 100644 --- a/docs/config/fonts.md +++ b/docs/config/fonts.md @@ -15,19 +15,17 @@ return { } ``` -The following options impact how text & glyphs are rendered: +The following options impact how text & glyphs are rendered. + +*Note*: for high-density (eg: 4K or Retina) display owners, you +may need to [adjust the DPI settings on some systems](lua/config/dpi.md) +to avoid blurry or tiny fonts. ```lua return { -- The font size, measured in points font_size = 11.0, - -- The DPI to assume, measured in dots-per-inch - -- This is not automatically probed! If you experience blurry text - -- or notice slight differences when comparing with other terminal - -- emulators, you may wish to tune this value! - dpi = 96.0, - -- (available starting in version 20210203-095643-70a364eb) -- Scale the effective cell height. -- The cell height is computed based on your selected font_size diff --git a/docs/config/lua/config/dpi.md b/docs/config/lua/config/dpi.md new file mode 100644 index 000000000..384ce55ca --- /dev/null +++ b/docs/config/lua/config/dpi.md @@ -0,0 +1,42 @@ +# `dpi` + +Override the detected DPI (dots per inch) for the display. + +This can be useful if the detected DPI is inaccurate and the text appears +either blurry or too small (especially if you are using a 4K display on X11 or +Wayland). + +The default value is system specific: + +|OS |Standard Density |High Density| +|---------------|------------------------|------------| +|macOS |72.0 |144.0 | +|Windows |Probed from the display |Probed from the display | +|X11 |96.0 |96.0 | +|X11 (*nightly builds of WezTerm*)|Probed from `Xft.dpi`, fallback to 96.0 |Probed from `Xft.dpi`, fallback to 96.0 | +|Wayland |96.0 |192.0 | + +In macOS and Wayland environments there isn't strictly a system DPI value that +can be queried; instead standard density has a fixed value and the system will +inform WezTerm when the display is high density by communicating a scaling +factor for the display. + +The Wayland protocol only allows for integer scaling factors, but some +compositors support fractional scaling. That fractional scaling can result in +blurry text and you may wish to specify a DPI value to compensate. + +On macOS the scaling factor changes based on the monitor on which the window is +displayed; dragging the window from a retina laptop display to an external +standard DPI display causes the window to automatically adjust to the DPI +scaling. + +Microsoft Windows reports the true DPI for the monitor on which the window is +displayed, and will similarly adjust as the window is dragged between monitors. + +DPI is poorly supported by X11 itself; while it is possible to query the +displays to determine their dimensions, the results are generally inaccurate. +It is common for X11 environments to publish an `Xft.dpi` value as a property +of the root window as a hint for the DPI of the display. While that is a +reasonable workaround for a single-monitor system, it isn't ideal for a +multi-monitor setup where the monitors have varying DPIs. +