diff --git a/config/src/lib.rs b/config/src/lib.rs index 29784e6f3..31d8da159 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -398,7 +398,11 @@ impl ConfigInner { fn use_test(&mut self) { FontLocatorSelection::ConfigDirsOnly.set_default(); - let config = Config::default_config(); + let mut config = Config::default_config(); + // Specify the same DPI used on non-mac systems so + // that we have consistent values regardless of the + // operating system that we're running tests on + config.dpi.replace(96.0); self.config = Arc::new(config); self.error.take(); self.generation += 1; diff --git a/wezterm-font/src/shaper/harfbuzz.rs b/wezterm-font/src/shaper/harfbuzz.rs index b073ef69b..4116625cb 100644 --- a/wezterm-font/src/shaper/harfbuzz.rs +++ b/wezterm-font/src/shaper/harfbuzz.rs @@ -465,6 +465,7 @@ mod test { font_idx: 0, glyph_pos: 180, num_cells: 1, + #[cfg(debug_assertions)] text: "a".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -477,6 +478,7 @@ mod test { font_idx: 0, glyph_pos: 205, num_cells: 1, + #[cfg(debug_assertions)] text: "b".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -489,6 +491,7 @@ mod test { font_idx: 0, glyph_pos: 206, num_cells: 1, + #[cfg(debug_assertions)] text: "c".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -510,6 +513,7 @@ mod test { font_idx: 0, glyph_pos: 726, num_cells: 1, + #[cfg(debug_assertions)] text: "<".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -533,6 +537,7 @@ mod test { font_idx: 0, glyph_pos: 1212, num_cells: 1, + #[cfg(debug_assertions)] text: "<".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -545,6 +550,7 @@ mod test { font_idx: 0, glyph_pos: 1065, num_cells: 1, + #[cfg(debug_assertions)] text: "-".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -567,6 +573,7 @@ mod test { font_idx: 0, glyph_pos: 726, num_cells: 1, + #[cfg(debug_assertions)] text: "<".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -579,6 +586,7 @@ mod test { font_idx: 0, glyph_pos: 1212, num_cells: 1, + #[cfg(debug_assertions)] text: "-".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.), @@ -591,6 +599,7 @@ mod test { font_idx: 0, glyph_pos: 623, num_cells: 1, + #[cfg(debug_assertions)] text: "-".into(), x_advance: PixelLength::new(6.), x_offset: PixelLength::new(0.),