Skip to content

Commit

Permalink
Refactor screen fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
zargony committed Sep 23, 2024
1 parent 5f90414 commit a5f5a9b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions firmware/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ static LOGO: ImageRaw<BinaryColor> = ImageRaw::new(&[
], 128);

const SPLASH_VERSION_FONT: FontRenderer = FontRenderer::new::<fonts::u8g2_font_profont10_tr>();
const DEFAULT_FONT: FontRenderer = FontRenderer::new::<fonts::u8g2_font_8x13_tf>();
const BOLD_FONT: FontRenderer = FontRenderer::new::<fonts::u8g2_font_8x13B_tf>();
const TOTAL_PRICE_FONT: FontRenderer = FontRenderer::new::<fonts::u8g2_font_8x13B_tf>();
const TITLE_FONT: FontRenderer = FontRenderer::new::<fonts::u8g2_font_8x13_tf>();
const SMALL_FONT: FontRenderer = FontRenderer::new::<fonts::u8g2_font_5x7_tf>();
const FOOTER_FONT: FontRenderer = FontRenderer::new::<fonts::u8g2_font_5x7_tf>();

Expand Down Expand Up @@ -101,7 +101,7 @@ impl Screen for ScanId {
&self,
target: &mut D,
) -> Result<(), Error<D::Error>> {
DEFAULT_FONT.render_aligned(
TITLE_FONT.render_aligned(
"Mitgliedsausweis\nscannen",
Point::new(63, 26),
VerticalPosition::Baseline,
Expand All @@ -121,7 +121,7 @@ impl Screen for NumberOfDrinks {
&self,
target: &mut D,
) -> Result<(), Error<D::Error>> {
DEFAULT_FONT.render_aligned(
TITLE_FONT.render_aligned(
"Anzahl Getränke\nwählen",
Point::new(63, 26),
VerticalPosition::Baseline,
Expand Down Expand Up @@ -154,7 +154,7 @@ impl Screen for Checkout {
&self,
target: &mut D,
) -> Result<(), Error<D::Error>> {
DEFAULT_FONT.render_aligned(
TITLE_FONT.render_aligned(
format_args!(
"{} {}",
self.num_drinks,
Expand All @@ -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,
Expand Down Expand Up @@ -199,7 +199,7 @@ impl Screen for Success {
&self,
target: &mut D,
) -> Result<(), Error<D::Error>> {
DEFAULT_FONT.render_aligned(
TITLE_FONT.render_aligned(
"Affirm!",
Point::new(63, 27),
VerticalPosition::Baseline,
Expand Down Expand Up @@ -236,7 +236,7 @@ impl<'a> Screen for Failure<'a> {
&self,
target: &mut D,
) -> Result<(), Error<D::Error>> {
DEFAULT_FONT.render_aligned(
TITLE_FONT.render_aligned(
"FEHLER!",
Point::new(63, 27),
VerticalPosition::Baseline,
Expand Down

0 comments on commit a5f5a9b

Please sign in to comment.