$wrap » History » Version 1
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 | size - Rhe font size to wrap with. |
||
| 12 | [word] - If specified with "1" or word is not specified, the wrapping is performed on whole words, otherwise performed on max length. |
||
| 13 | N - If N = 0 number of wrapped lines, otherwise the Nth wrapped line. |
||
| 14 | |||
| 15 | *Example* |
||
| 16 | |||
| 17 | <pre> |
||
| 18 | ; Show number of wrapped line for this text. |
||
| 19 | //echo -ag Number of wrapped lines is $wrap(veeeeeeerrrrrry long line, verdana, 9, 100, 0) |
||
| 20 | |||
| 21 | ; Show the first wrapped line for this text. |
||
| 22 | //echo -ag The first wrapped line is $wrap(veeeeeeerrrrrry long line, verdana, 9, 100, 1) |
||
| 23 | </pre> |