aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass2022-10-06 08:36:16 -0600
committerAnatolij Gustschin2022-10-30 20:01:40 +0100
commit430e1676a76bf8b7112c64e19cf64b988c281ee0 (patch)
tree97d40e3ae1f3305177622818c23d7195b3370e22 /drivers
parent3f425f9ca75c8d1938579044fde37a6f7d5abe16 (diff)
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 <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console_truetype.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index 09421e7a905..6859c9fa116 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -715,6 +715,16 @@ int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
return 0;
}
+const char *vidconsole_get_font(struct udevice *dev, uint *sizep)
+{
+ struct console_tt_priv *priv = dev_get_priv(dev);
+ struct console_tt_metrics *met = priv->cur_met;
+
+ *sizep = met->font_size;
+
+ return met->font_name;
+}
+
static int console_truetype_probe(struct udevice *dev)
{
struct console_tt_priv *priv = dev_get_priv(dev);