From fdf10f369e90b903a3db34f24b539ccbc81ae639 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 30 Jan 2024 00:02:42 +0800 Subject: [PATCH] fix default font settings there's something....weird....going on in the initializers here and ... something about configurations not being applicable to expressions?? i'm a little confused, but, the original work-around I had to this isuse somehow side-effected things in some way that I didn't expect. this reverts those side effects. --- services/graphics-server/src/wordwrap.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/services/graphics-server/src/wordwrap.rs b/services/graphics-server/src/wordwrap.rs index b3bb80089..567deb68f 100644 --- a/services/graphics-server/src/wordwrap.rs +++ b/services/graphics-server/src/wordwrap.rs @@ -235,13 +235,17 @@ impl Typesetter { let mut ellipsis = style_glyph('…', base_style); ellipsis.kern = 0; - #[cfg(feature = "cramium-soc")] - let base_style = GlyphStyle::Tall; #[cfg(not(feature = "cramium-soc"))] - let base_style = GlyphStyle::Cjk; + let mut large_space = style_glyph(' ', &GlyphStyle::Cjk); + #[cfg(feature = "cramium-soc")] + let mut large_space = style_glyph(' ', &GlyphStyle::Tall); + + if cfg!(feature = "cramium-soc") { + large_space.wide = glyph_to_height_hint(GlyphStyle::Tall) as u8; + } else { + large_space.wide = glyph_to_height_hint(GlyphStyle::Cjk) as u8; + } - let mut large_space = style_glyph(' ', &base_style); - large_space.wide = glyph_to_height_hint(base_style) as u8; Typesetter { charpos: 0, cursor: Cursor::new(0, 0, 0),