From 1f8908cddbf9570f76653aef3f6aa2f16d589800 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 24 Apr 2021 12:02:52 -0700 Subject: [PATCH] fonts: revise cap_height adjustment back out the portion of the cap height scaling that applied when we knew the cap height of the primary font but not a fallback font. That logic allowed some overly wide powerline fonts to be sized correctly (a bit smaller), but also meant that a number of emoji and other symbol glyphs were now undersized. refs: https://github.com/wez/wezterm/issues/727 --- wezterm-gui/src/glyphcache.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wezterm-gui/src/glyphcache.rs b/wezterm-gui/src/glyphcache.rs index 1e6e39337..9a9c3ed36 100644 --- a/wezterm-gui/src/glyphcache.rs +++ b/wezterm-gui/src/glyphcache.rs @@ -483,9 +483,13 @@ impl GlyphCache { } else { // Otherwise, we scale based on the ratio of the metrics for // the two fonts. + // If we know the cap height ratio for the first, we can adjust - // the overall scale so that the second font isn't oversized - let base_cap = base_metrics.cap_height_ratio.unwrap_or(1.); + // the overall scale so that the second font isn't oversized. + // Disable for now because it leads to emoji and other symbols + // being under-sized :-/ + // https://github.com/wez/wezterm/issues/727 + let base_cap = 1.0; // base_metrics.cap_height_ratio.unwrap_or(1.); y_scale = base_cap * base_metrics.cell_height.get() / idx_metrics.cell_height.get(); x_scale = base_cap * base_metrics.cell_width.get() / (idx_metrics.cell_width.get() / info.num_cells as f64);