From 97df8960240afc47c2349d008b0993e7727bbda5 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 7 Apr 2026 11:23:14 +0200 Subject: lib/fonts: Provide helpers for calculating glyph pitch and size Implement pitch and size calculation for a single font glyph in the new helpers font_glyph_pitch() and font_glyph_size(). Replace the instances where the calculations are open-coded. Note that in the case of fbcon console rotation, the parameters for a glyph's width and height might be reversed. This is intentional. v2: - fix typos in commit message Signed-off-by: Thomas Zimmermann Signed-off-by: Helge Deller --- lib/fonts/fonts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/fonts/fonts.c b/lib/fonts/fonts.c index 5938f542906b..f5d5333450a0 100644 --- a/lib/fonts/fonts.c +++ b/lib/fonts/fonts.c @@ -26,7 +26,7 @@ #include "font.h" -#define console_font_pitch(font) DIV_ROUND_UP((font)->width, 8) +#define console_font_pitch(font) font_glyph_pitch((font)->width) /* * Helpers for font_data_t -- cgit v1.2.3