diff options
| author | Simon Glass <[email protected]> | 2025-04-02 06:29:36 +1300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-05-02 13:40:25 -0600 |
| commit | 236ae39fb0c571d2553271a7fa75920348f9c5eb (patch) | |
| tree | c8790ebae8423023fa1585ce6557a3369da6316c /drivers | |
| parent | 0d0b2341dd419c7c56def9e23f31625da2d31168 (diff) | |
video: Begin support for measuring multiple lines of text
Update the vidconsole API so that measure() can measure multiple lines
of text. This will make it easier to implement multi-line fields in
expo.
Tidy up the function comments while we are here.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/video/console_truetype.c | 3 | ||||
| -rw-r--r-- | drivers/video/vidconsole-uclass.c | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 980baee83cf..7b9033818d3 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -733,7 +733,8 @@ static int truetype_select_font(struct udevice *dev, const char *name, } static int truetype_measure(struct udevice *dev, const char *name, uint size, - const char *text, struct vidconsole_bbox *bbox) + const char *text, struct vidconsole_bbox *bbox, + struct alist *lines) { struct console_tt_metrics *met; stbtt_fontinfo *font; diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index a1dfd35b7b8..4ca41dc331e 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -608,14 +608,17 @@ int vidconsole_select_font(struct udevice *dev, const char *name, uint size) } int vidconsole_measure(struct udevice *dev, const char *name, uint size, - const char *text, struct vidconsole_bbox *bbox) + const char *text, struct vidconsole_bbox *bbox, + struct alist *lines) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); struct vidconsole_ops *ops = vidconsole_get_ops(dev); int ret; if (ops->measure) { - ret = ops->measure(dev, name, size, text, bbox); + if (lines) + alist_empty(lines); + ret = ops->measure(dev, name, size, text, bbox, lines); if (ret != -ENOSYS) return ret; } |
