Skip to content

Commit

Permalink
Support single-L label statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cwervo committed Nov 25, 2024
1 parent baa0259 commit e450a10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions virtual-programs/label.folk
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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"
Expand Down

0 comments on commit e450a10

Please sign in to comment.