+ # Distance between the beginning and the end of the longest line of `text`
+ fun text_width(text: String): Numeric
+ do
+ var lines = text.split('\n')
+ if lines.is_empty then return 0
+
+ var longest = 0
+ for line in lines do longest = longest.max(line.length)
+
+ return longest.mul(advance)
+ end
+