summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-04-07 11:23:14 +0200
committerHelge Deller <deller@gmx.de>2026-04-07 17:38:07 +0200
commit97df8960240afc47c2349d008b0993e7727bbda5 (patch)
tree27d0e8bf365339335652e27ac8e6756ef6defaca /lib
parentc713b96427ce5c4a74b8babe14137451ac3ffe54 (diff)
downloadlwn-97df8960240afc47c2349d008b0993e7727bbda5.tar.gz
lwn-97df8960240afc47c2349d008b0993e7727bbda5.zip
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 <tzimmermann@suse.de> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/fonts/fonts.c2
1 files changed, 1 insertions, 1 deletions
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