diff --git a/emigui/src/context.rs b/emigui/src/context.rs index 924f3edb..978b82aa 100644 --- a/emigui/src/context.rs +++ b/emigui/src/context.rs @@ -194,7 +194,7 @@ impl Context { pub fn show_error(&self, pos: Pos2, text: &str) { let align = (Align::Min, Align::Min); - let layer = Layer::Popup; // TODO: Layer::Debug + let layer = Layer::Debug; let text_style = TextStyle::Monospace; let font = &self.fonts[text_style]; let (text, size) = font.layout_multiline(text, f32::INFINITY); @@ -212,7 +212,7 @@ impl Context { } pub fn debug_text(&self, pos: Pos2, text: &str) { - let layer = Layer::Popup; // TODO: Layer::Debug + let layer = Layer::Debug; let align = (Align::Min, Align::Min); self.floating_text( layer, diff --git a/emigui/src/fonts.rs b/emigui/src/fonts.rs index f96878c2..2f9fa116 100644 --- a/emigui/src/fonts.rs +++ b/emigui/src/fonts.rs @@ -83,11 +83,10 @@ impl Fonts { // TODO: figure out a way to make the wasm smaller despite including a font. Zip it? let monospae_typeface_data = include_bytes!("../fonts/ProggyClean.ttf"); // Use 13 for this. NOTHING ELSE. + // let monospae_typeface_data = include_bytes!("../fonts/Roboto-Regular.ttf"); - // let monospae_typeface_data = include_bytes!("../fonts/Roboto-Regular.ttf"); - - let variable_typeface_data = include_bytes!("../fonts/Comfortaa-Regular.ttf"); - // let variable_typeface_data = include_bytes!("../fonts/DejaVuSans.ttf"); + // let variable_typeface_data = include_bytes!("../fonts/Comfortaa-Regular.ttf"); // Funny, hard to read + let variable_typeface_data = include_bytes!("../fonts/DejaVuSans.ttf"); // Basic, boring self.definitions = definitions.clone(); self.fonts = definitions diff --git a/emigui/src/layers.rs b/emigui/src/layers.rs index fe42b961..50cf8cbd 100644 --- a/emigui/src/layers.rs +++ b/emigui/src/layers.rs @@ -9,6 +9,8 @@ pub enum Layer { Window(Id), /// Tooltips etc Popup, + /// Debug text + Debug, } /// Each PaintCmd is paired with a clip rectangle. @@ -20,6 +22,7 @@ pub struct GraphicLayers { bg: PaintList, windows: HashMap, popup: PaintList, + debug: PaintList, } impl GraphicLayers { @@ -28,6 +31,7 @@ impl GraphicLayers { Layer::Background => &mut self.bg, Layer::Window(id) => self.windows.entry(id).or_default(), Layer::Popup => &mut self.popup, + Layer::Debug => &mut self.debug, } } @@ -44,6 +48,7 @@ impl GraphicLayers { } all_commands.extend(self.popup.drain(..)); + all_commands.extend(self.debug.drain(..)); all_commands.into_iter() } }