video: Add font functions to the vidconsole API

Support for fonts currently depends on the type of vidconsole in use. Add
two new methods to enumerate fonts and to set the font.

Fix a few other method comments while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2023-01-06 08:52:32 -06:00
committed by Tom Rini
parent 5abd8bb0f2
commit 0e38bd848d
5 changed files with 127 additions and 25 deletions

View File

@@ -33,7 +33,7 @@ static int font_test_base(struct unit_test_state *uts)
ut_assertok(ut_check_console_end(uts));
ut_asserteq_str("nimbus_sans_l_regular",
vidconsole_get_font(dev, &size));
vidconsole_get_font_size(dev, &size));
ut_asserteq(18, size);
max_metrics = 1;
@@ -53,14 +53,14 @@ static int font_test_base(struct unit_test_state *uts)
ut_assertok(ut_check_console_end(uts));
ut_asserteq_str("cantoraone_regular",
vidconsole_get_font(dev, &size));
vidconsole_get_font_size(dev, &size));
ut_asserteq(40, size);
ut_assertok(run_command("font size 30", 0));
ut_assertok(ut_check_console_end(uts));
ut_asserteq_str("cantoraone_regular",
vidconsole_get_font(dev, &size));
vidconsole_get_font_size(dev, &size));
ut_asserteq(30, size);
return 0;