1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-27 15:37:29 +03:00

render more symbol/icon/emoji at double width by default

Default `allow_square_glyphs_to_overflow_width="WhenFollowedBySpace"`,
and expand its meaning from mostly square glyphs to glyphs that are
also wider than they are tall.

refs: https://github.com/wez/wezterm/issues/565
This commit is contained in:
Wez Furlong 2021-03-22 11:36:45 -07:00
parent 4fa85e7037
commit 22522dc39e
4 changed files with 15 additions and 5 deletions

View File

@ -354,7 +354,7 @@ pub enum AllowSquareGlyphOverflow {
impl Default for AllowSquareGlyphOverflow {
fn default() -> Self {
Self::Never
Self::WhenFollowedBySpace
}
}

View File

@ -20,6 +20,7 @@ brief notes about them may accumulate here.
* Fixed: panic when dismissing the tab navigator [#542](https://github.com/wez/wezterm/issues/542)
* Fixed: font fallback on macOS returns unresolvable `.AppleSymbolsFB` rather than `Apple Symbols`, leading to slowdowns when rendering symbols [#506](https://github.com/wez/wezterm/issues/506)
* Fixed: laggy repaints for large windows particularly on Windows, but applicable to all systems. Tuned and triple-buffered vertex buffer updates. [#546](https://github.com/wez/wezterm/issues/546)
* Changed: [allow_square_glyphs_to_overflow_width](config/lua/config/allow_square_glyphs_to_overflow_width.md) now defaults to `WhenFollowedBySpace` and applies to more symbol glyphs. [#565](https://github.com/wez/wezterm/issues/565)
### 20210314-114017-04b7cedd

View File

@ -9,3 +9,11 @@ Configures how square symbol glyph's cell is rendered:
* "Always" - overflow the cell regardless of the next cell
being a space.
* "Never" (the default) - strictly respect the cell width.
*Since: nightly builds*
This setting now applies to any glyph with an aspect ratio
larger than 0.9, which covers more symbol glyphs than in
earlier releases.
The default value for this setting has changed to `WhenFollowedBySpace`.

View File

@ -440,9 +440,9 @@ impl<T: Texture2d> GlyphCache<T> {
base_metrics.cell_width.get() / (idx_metrics.cell_width.get() / info.num_cells as f64);
let aspect = (idx_metrics.cell_height / idx_metrics.cell_width).get();
let is_square = aspect >= 0.9 && aspect <= 1.1;
let is_square_or_wide = aspect >= 0.9;
let allow_width_overflow = if is_square {
let allow_width_overflow = if is_square_or_wide {
match configuration().allow_square_glyphs_to_overflow_width {
AllowSquareGlyphOverflow::Never => false,
AllowSquareGlyphOverflow::Always => true,
@ -489,13 +489,14 @@ impl<T: Texture2d> GlyphCache<T> {
let (scale, raw_im) = if scale != 1.0 {
log::trace!(
"physically scaling {:?} by {} bcos {}x{} > {:?}x{:?}",
"physically scaling {:?} by {} bcos {}x{} > {:?}x{:?}. aspect={}",
info,
scale,
glyph.width,
glyph.height,
cell_width,
cell_height
cell_height,
aspect,
);
(1.0, raw_im.scale_by(scale))
} else {