lib: simplefb: calculate font scaling factor dynamically

Instead of hardcoding it to 2 for all devices, scale it dynamically
per device width and height.
This commit is contained in:
Ivaylo Ivanov
2025-08-07 13:10:04 +03:00
parent 5f0cca1951
commit 1b07caaea4
4 changed files with 36 additions and 10 deletions

View File

@@ -69,7 +69,7 @@ static inline void fb_output(const char *prefix, const char *message, color text
{
#ifdef CONFIG_SIMPLE_FB
const int y_pos = 5;
const int prefix_width = strlen(prefix) * SCALED_FONTW;
const int prefix_width = strlen(prefix) * FONTW * get_font_scale_factor();
__simplefb_raw_print(prefix, 0, y_pos, text_color);
__simplefb_raw_print(message, prefix_width, y_pos, gray);