From a5f5a9b85fee7f662ad219d35de2cf3d0e889ba5 Mon Sep 17 00:00:00 2001 From: Andreas Neuhaus Date: Mon, 23 Sep 2024 21:08:05 +0200 Subject: [PATCH] Refactor screen fonts --- firmware/src/screen.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/firmware/src/screen.rs b/firmware/src/screen.rs index d60eecc..8f0c46c 100644 --- a/firmware/src/screen.rs +++ b/firmware/src/screen.rs @@ -33,8 +33,8 @@ static LOGO: ImageRaw = ImageRaw::new(&[ ], 128); const SPLASH_VERSION_FONT: FontRenderer = FontRenderer::new::(); -const DEFAULT_FONT: FontRenderer = FontRenderer::new::(); -const BOLD_FONT: FontRenderer = FontRenderer::new::(); +const TOTAL_PRICE_FONT: FontRenderer = FontRenderer::new::(); +const TITLE_FONT: FontRenderer = FontRenderer::new::(); const SMALL_FONT: FontRenderer = FontRenderer::new::(); const FOOTER_FONT: FontRenderer = FontRenderer::new::(); @@ -101,7 +101,7 @@ impl Screen for ScanId { &self, target: &mut D, ) -> Result<(), Error> { - DEFAULT_FONT.render_aligned( + TITLE_FONT.render_aligned( "Mitgliedsausweis\nscannen", Point::new(63, 26), VerticalPosition::Baseline, @@ -121,7 +121,7 @@ impl Screen for NumberOfDrinks { &self, target: &mut D, ) -> Result<(), Error> { - DEFAULT_FONT.render_aligned( + TITLE_FONT.render_aligned( "Anzahl Getränke\nwählen", Point::new(63, 26), VerticalPosition::Baseline, @@ -154,7 +154,7 @@ impl Screen for Checkout { &self, target: &mut D, ) -> Result<(), Error> { - DEFAULT_FONT.render_aligned( + TITLE_FONT.render_aligned( format_args!( "{} {}", self.num_drinks, @@ -170,7 +170,7 @@ impl Screen for Checkout { FontColor::Transparent(BinaryColor::On), target, )?; - BOLD_FONT.render_aligned( + TOTAL_PRICE_FONT.render_aligned( format_args!("{:.02} EUR", self.total_price), Point::new(63, 25 + 16), VerticalPosition::Baseline, @@ -199,7 +199,7 @@ impl Screen for Success { &self, target: &mut D, ) -> Result<(), Error> { - DEFAULT_FONT.render_aligned( + TITLE_FONT.render_aligned( "Affirm!", Point::new(63, 27), VerticalPosition::Baseline, @@ -236,7 +236,7 @@ impl<'a> Screen for Failure<'a> { &self, target: &mut D, ) -> Result<(), Error> { - DEFAULT_FONT.render_aligned( + TITLE_FONT.render_aligned( "FEHLER!", Point::new(63, 27), VerticalPosition::Baseline,