From 430e1676a76bf8b7112c64e19cf64b988c281ee0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Oct 2022 08:36:16 -0600 Subject: video: Add commands to list and change fonts Add a new 'font' command which allows the fonts to be listed as well as selecting a different font and size. Allow the test to run on sandbox, where multiple font/size combinations are supported, as well as sandbox_flattree, where they are not. Signed-off-by: Simon Glass --- include/test/suites.h | 1 + include/video_console.h | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/test/suites.h b/include/test/suites.h index 44025ccecd6..a01000e127b 100644 --- a/include/test/suites.h +++ b/include/test/suites.h @@ -39,6 +39,7 @@ int do_ut_compression(struct cmd_tbl *cmdtp, int flag, int argc, int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +int do_ut_font(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_loadm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); diff --git a/include/video_console.h b/include/video_console.h index bef926cd433..d755eb73cf2 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -247,6 +247,15 @@ void vidconsole_list_fonts(void); */ int vidconsole_select_font(struct udevice *dev, const char *name, uint size); +/** + * vidconsole_get_font() - get the current font name and size + * + * @dev: vidconsole device + * @sizep: Place to put the font size (nominal height in pixels) + * Returns: Current font name + */ +const char *vidconsole_get_font(struct udevice *dev, uint *sizep); + #ifdef CONFIG_VIDEO_COPY /** * vidconsole_sync_copy() - Sync back to the copy framebuffer -- cgit v1.2.3