summaryrefslogtreecommitdiff
path: root/include/linux/font.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-05-29 16:01:23 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2026-06-04 09:44:09 +0200
commit98a6cabfd805d55a1b2c70b01923ec9b9bbc706a (patch)
tree4399e42d0f6251d3beb6f7e889853887bcbf821e /include/linux/font.h
parent6e7eb171ac96fefa32197afa658e7d9da238be89 (diff)
lib/fonts: Look up glyph data with font_data_glyph_buf()
Add font_data_glyph_buf() to retrieve a character's glyph data or NULL otherwise. Console fonts can currently contain 256 or 512 glyphs. The kernel-internal characters are of type char, unsigned short or unsigned int. Catch all of them by accepting unsigned int. Callers possibly have to cast from signed to unsigned types to reach all glyphs in a font. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patch.msgid.link/20260529140759.529929-2-tzimmermann@suse.de
Diffstat (limited to 'include/linux/font.h')
-rw-r--r--include/linux/font.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/font.h b/include/linux/font.h
index 6845f02d739a..ea23b727388b 100644
--- a/include/linux/font.h
+++ b/include/linux/font.h
@@ -101,6 +101,9 @@ font_data_t *font_data_import(const struct console_font *font, unsigned int vpit
void font_data_get(font_data_t *fd);
bool font_data_put(font_data_t *fd);
unsigned int font_data_size(font_data_t *fd);
+const unsigned char *font_data_glyph_buf(font_data_t *fd,
+ unsigned int width, unsigned int vpitch,
+ unsigned int c);
bool font_data_is_equal(font_data_t *lhs, font_data_t *rhs);
int font_data_export(font_data_t *fd, struct console_font *font, unsigned int vpitch);