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 committed 2025-08-07 13:13:05 +03:00
1 parent 5f0cca1951
commit 1b07caaea4
4 files changed
+36 -10

No files matched your search

+3
View File
@@ -28,6 +28,7 @@ struct video_info {
int width;
int height;
int stride;
int scale_f;
void *address;
};
@@ -35,6 +36,8 @@ extern void __simplefb_raw_print(const char *text, int text_x, int text_y,
color text_color);
extern void simplefb_probe(void *data);
int get_font_scale_factor(void);
typedef struct _font_params {
int width;
int height;
-5
View File
@@ -9,11 +9,6 @@
#define FONTW 8
#define FONTH 16
// Define scaled font dimensions --> 8x16 becomes 16x32
#define SCALE_FACTOR 2
#define SCALED_FONTW (FONTW * SCALE_FACTOR)
#define SCALED_FONTH (FONTH * SCALE_FACTOR)
static unsigned char letters[256][16] = {
// 32 ' '---
{