expo: Support rendering multiple lines of text

Use the measurement info to write each line of text separately, thus
respecting word-wrapping and newlines.

Fix up the comment for scene_obj_render() while we are here.

Since a lineedit does not support alignment, add a special case to just
display the text if there is no measurement. This happens assuming the
lineedit is initially empty.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-05-02 08:46:42 -06:00
parent b62a8cfbb6
commit 03f9ce815c
4 changed files with 41 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
#define __EXPO_H
#include <abuf.h>
#include <alist.h>
#include <dm/ofnode_decl.h>
#include <linux/bitops.h>
#include <linux/list.h>
@@ -296,11 +297,14 @@ struct scene_obj_img {
* @str_id: ID of the text string to display
* @font_name: Name of font (allocated by caller)
* @font_size: Nominal size of font in pixels
* @lines: alist of struct vidconsole_mline with a separate record for each
* line of text
*/
struct scene_txt_generic {
uint str_id;
const char *font_name;
uint font_size;
struct alist lines;
};
/**