Project

General

Profile

$wrap » History » Version 2

Per Amundsen, 12/23/2018 04:51 AM

1 1 Per Amundsen
_Added in 3.3_
2
3
*$wrap(text, font, size, width, [word,] N)*
4
5
Returns the Nth line in text wrapped to the specified width in pixels.
6
7
*Parameters*
8
9
text - The text to wrap.
10
font - The font to wrap with.
11 2 Per Amundsen
size - The font size to wrap with.
12
width - The width in pixels for the area to wrap to.
13 1 Per Amundsen
[word] - If specified with "1" or word is not specified, the wrapping is performed on whole words, otherwise performed on max length.
14
N - If N = 0 number of wrapped lines, otherwise the Nth wrapped line.
15
16
*Example*
17
18
<pre>
19
; Show number of wrapped line for this text.
20
//echo -ag Number of wrapped lines is $wrap(veeeeeeerrrrrry long line, verdana, 9, 100, 0)
21
22
; Show the first wrapped line for this text.
23
//echo -ag The first wrapped line is $wrap(veeeeeeerrrrrry long line, verdana, 9, 100, 1)
24
</pre>