[Concept,15/27] expo: Dump the line-measurement info

Message ID 20260119204130.3972647-16-sjg@u-boot.org
State New
Headers
Series Expo debugging and textedit improvements (part E) |

Commit Message

Simon Glass Jan. 19, 2026, 8:41 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add mline (measurement line) information to the text object dump,
showing the start offset, length, and bounding box for each line.
This helps debug text layout and word-wrapping issues.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 boot/expo_dump.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/boot/expo_dump.c b/boot/expo_dump.c
index d357aa6a5be..cb0a1e443e3 100644
--- a/boot/expo_dump.c
+++ b/boot/expo_dump.c
@@ -13,6 +13,7 @@ 
 #include <mapmem.h>
 #include <membuf.h>
 #include <video.h>
+#include <video_console.h>
 #include "scene_internal.h"
 
 /**
@@ -111,6 +112,7 @@  static void dump_menu(struct dump_ctx *ctx, struct scene_obj_menu *menu)
 static void dump_text(struct dump_ctx *ctx, struct scene_obj_txt *txt)
 {
 	const char *str = expo_get_str(ctx->scn->expo, txt->gen.str_id);
+	const struct vidconsole_mline *mline;
 
 	outf(ctx, "Text: str_id %x font_name '%s' font_size %x\n",
 	     txt->gen.str_id,
@@ -118,6 +120,12 @@  static void dump_text(struct dump_ctx *ctx, struct scene_obj_txt *txt)
 	     txt->gen.font_size);
 	ctx->indent += 2;
 	outf(ctx, "str '%s'\n", str ? str : "(null)");
+	alist_for_each(mline, &txt->gen.lines) {
+		outf(ctx, "mline: start %x len %x bbox (%x,%x)-(%x,%x)\n",
+		     mline->start, mline->len,
+		     mline->bbox.x0, mline->bbox.y0,
+		     mline->bbox.x1, mline->bbox.y1);
+	}
 	ctx->indent -= 2;
 }