mirror of
https://github.com/wez/wezterm.git
synced 2024-11-12 21:30:45 +03:00
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
This commit is contained in:
parent
2520b6bd1d
commit
1f8908cddb
@ -483,9 +483,13 @@ impl<T: Texture2d> GlyphCache<T> {
|
||||
} 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);
|
||||
|
Loading…
Reference in New Issue
Block a user