From e450a106eb55391d41ef395038546639e4d82029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Cuervo?= Date: Sun, 24 Nov 2024 19:24:09 -0500 Subject: [PATCH] Support single-L label statements --- virtual-programs/label.folk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk index 88a86c18..4b65784c 100644 --- a/virtual-programs/label.folk +++ b/virtual-programs/label.folk @@ -2,6 +2,13 @@ When /thing/ has region /region/ { lassign [region centroid $region] x y set radians [region angle $region] + + When the collected matches for [list /someone/ wishes $thing is labeled /text/ with font /font/] are /matches/ { + set text [join [lmap match $matches {dict get $match text}] "\n"] + if {$text eq ""} { return } + Wish $thing is labelled $text with font [dict get $match font] + } + When the collected matches for [list /someone/ wishes $thing is labelled /text/ with font /font/] are /matches/ { set text [join [lmap match $matches {dict get $match text}] "\n"] if {$text eq ""} { return } @@ -10,6 +17,10 @@ When /thing/ has region /region/ { } } +When /someone/ wishes /thing/ is labeled /text/ { + Wish $thing is labelled $text +} + When /someone/ wishes /thing/ is labelled /text/ { # Set the default font Wish $thing is labelled $text with font "PTSans-Regular"