diff options
Diffstat (limited to 'payloads/libpayload/drivers/video/font.c')
-rw-r--r-- | payloads/libpayload/drivers/video/font.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/payloads/libpayload/drivers/video/font.c b/payloads/libpayload/drivers/video/font.c index 59d476dacf..8758a9646e 100644 --- a/payloads/libpayload/drivers/video/font.c +++ b/payloads/libpayload/drivers/video/font.c @@ -27,14 +27,22 @@ * SUCH DAMAGE. */ +#include <libpayload.h> #include "font8x16.h" #include "font.h" +#define COLS_MIN 130 + int font_width; int font_height; +int font_scale; -void font_init(void) +void font_init(int width) { - font_width = FONT_WIDTH; - font_height = FONT_HEIGHT; + font_scale = CONFIG_LP_FONT_SCALE_FACTOR; + if (!font_scale) + font_scale = MAX(width / (FONT_WIDTH * COLS_MIN), 1); + + font_width = FONT_WIDTH * font_scale; + font_height = FONT_HEIGHT * font_scale; } |