From a29b012037cc454ec811dbcd29a3aeffe59d86bc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 14 Jan 2016 18:10:42 -0700 Subject: video: Add a console driver that uses TrueType fonts The existing 8x16 font is adequate for most purposes. It is small and fast. However for boot screens where information must be presented to the user, the console font is not ideal. Common requirements are larger and better-looking fonts. This console driver can use TrueType fonts built into U-Boot, and render them at any size. This can be used in scripts to place text as needed on the display. This driver is not really designed to operate with the command line. Much of U-Boot expects a fixed-width font. But to keep things working correctly, rudimentary support for the console is provided. The main missing feature is support for command-line editing. Signed-off-by: Simon Glass Signed-off-by: Anatolij Gustschin --- drivers/video/video-uclass.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/video/video-uclass.c') diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 24d537e6c4..2189fce369 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -201,11 +201,18 @@ static int video_post_probe(struct udevice *dev) * it might be useful to support only bitmap drawing on the device * for boards that don't need to display text. */ - snprintf(name, sizeof(name), "%s.vidconsole", dev->name); + if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE)) { + snprintf(name, sizeof(name), "%s.vidconsole_tt", dev->name); + strcpy(drv, "vidconsole_tt"); + } else { + snprintf(name, sizeof(name), "%s.vidconsole%d", dev->name, + priv->rot); + snprintf(drv, sizeof(drv), "vidconsole%d", priv->rot); + } + str = strdup(name); if (!str) return -ENOMEM; - snprintf(drv, sizeof(drv), "vidconsole%d", priv->rot); ret = device_bind_driver(dev, drv, str, &cons); if (ret) { debug("%s: Cannot bind console driver\n", __func__); -- cgit v1.2.3