Skip to content

Conversation

weberval
Copy link

@weberval weberval commented Jul 19, 2025

To use the available space on the bade more efficient, I changed the font to u8g2_font_lucasfont_alternate_tf from
u8g2-fonts.

Lucasfont Alternate was created by Patrick Lauke and is licensed under CC BY 3.0. No changes to the font were made.

Summary by Sourcery

Switch default font to Lucasfont Alternate for improved screen space usage, update text rendering position, and include the u8g2-fonts dependency.

New Features:

  • Switch display font to u8g2_font_lucasfont_alternate_tf for more efficient use of screen space

Enhancements:

  • Adjust text baseline from y=7 to y=8 to accommodate the new font

Build:

  • Add u8g2-fonts crate with embedded_graphics_textstyle feature for the new font

weberval added 2 commits July 19, 2025 16:28
To use the available space on the bade more efficient, I changed the
font to u8g2_font_lucasfont_alternate_tf from
[u8g2-fonts](https://docs.rs/crate/u8g2-fonts/).

Lucasfont Alternate was created by Patrick Lauke and is licensed under
[CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
No changes to the font were made.
Copy link

sourcery-ai bot commented Jul 19, 2025

Reviewer's Guide

Replaces the existing 6x9 monospaced font with the compact Lucasfont Alternate via U8g2TextStyle (adjusting the text baseline), and adds the u8g2-fonts dependency.

Entity relationship diagram for font dependency update

erDiagram
    MAIN_RS ||--o{ U8G2_FONTS : uses
    U8G2_FONTS {
        string u8g2_font_lucasfont_alternate_tf
    }
    MAIN_RS {
        string font
        string text_style
    }
Loading

Class diagram for font rendering update in main.rs

classDiagram
    class Text {
        +new(text: &str, position: Point, style: impl TextStyle)
    }
    class MonoTextStyle {
        +new(font: Font, color: BinaryColor)
    }
    class U8g2TextStyle {
        +new(font: U8g2Font, color: BinaryColor)
    }
    class FONT_6X9
    class u8g2_font_lucasfont_alternate_tf
    MonoTextStyle --|> TextStyle
    U8g2TextStyle --|> TextStyle
    FONT_6X9 <|-- MonoTextStyle
    u8g2_font_lucasfont_alternate_tf <|-- U8g2TextStyle
    Text o-- TextStyle

    %% Highlight the change: MonoTextStyle replaced by U8g2TextStyle, FONT_6X9 replaced by u8g2_font_lucasfont_alternate_tf
Loading

File-Level Changes

Change Details Files
Swap out MonoTextStyle(FONT_6X9) for U8g2TextStyle(u8g2_font_lucasfont_alternate_tf) and adjust the text origin
  • Y-coordinate for text shifted from 7 to 8
  • Text style constructor changed from MonoTextStyle to U8g2TextStyle with new font
src/main.rs
Introduce u8g2-fonts crate to project dependencies
  • Added u8g2-fonts = { version = "0.7.1", features = ["embedded_graphics_textstyle"] } to Cargo.toml
Cargo.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @weberval - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@weberval weberval changed the title feat: switch font to u8g2_font_lucasfont_alternate_tf feat: switch font to u8g2_font_lucasfont_alternate_tf @sourcery-ai Jul 20, 2025
@sourcery-ai sourcery-ai bot changed the title feat: switch font to u8g2_font_lucasfont_alternate_tf @sourcery-ai Use Lucasfont Alternate font for efficient display Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant