From 67ac570d4bf076d1936cc98ec0683b257393d2c8 Mon Sep 17 00:00:00 2001 From: Linklancien <123779978+Linklancien@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:21:25 +0100 Subject: [PATCH] gg: add draw_text in gg/testdata (#26404) --- vlib/gg/testdata/draw_text.vv | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 vlib/gg/testdata/draw_text.vv diff --git a/vlib/gg/testdata/draw_text.vv b/vlib/gg/testdata/draw_text.vv new file mode 100644 index 000000000..06f60be5e --- /dev/null +++ b/vlib/gg/testdata/draw_text.vv @@ -0,0 +1,45 @@ +module main + +import gg + +gg.start( + width: 640 + height: 300 + window_title: 'Circles' + frame_fn: fn (mut ctx gg.Context) { + ctx.begin() + ctx.draw_text(10, 10, 'This text is at x: 10, y: 10', gg.TextCfg{ color: gg.white, size: 20 }) + ctx.draw_text(10, 40, 'This text is at x: 10, y: 40 and bold', gg.TextCfg{ + color: gg.white + bold: true + size: 20 + }) + ctx.draw_text(10, 70, 'This text is at x: 10, y: 70 and italic', gg.TextCfg{ + color: gg.white + size: 20 + italic: true + }) + ctx.draw_text(10, 100, 'This text is at x: 10, y: 110 and mono', gg.TextCfg{ + color: gg.white + size: 20 + mono: true + }) + ctx.draw_text(10, 130, 'This text is at x: 10, y: 130 and twice as big', gg.TextCfg{ + color: gg.white + size: 40 + }) + ctx.draw_text(10, 180, 'This text is at x: 10, y: 180 and red', gg.TextCfg{ + color: gg.red + size: 20 + }) + ctx.draw_text(10, 210, 'This text is at x: 10, y: 210 and blue', gg.TextCfg{ + color: gg.blue + size: 20 + }) + ctx.draw_text(10, 240, 'This text is at x: 10, y: 240 and green', gg.TextCfg{ + color: gg.green + size: 20 + }) + ctx.end() + } +) -- 2.39.5