string split width - part-cw/lambdanative GitHub Wiki
(string-split-width str w fnt)
string-split-width returns a modified version of string str which is wrapped to fit into a window of width w using the fontsize obtained from font.
What is returned is a list, where each string in the list is one of the lines. The strings are also split by the new line character \n, which forces a new line.
| Parameter | Description |
|---|---|
| str | The string to be split |
| w | The maximal width before a split has to occur |
| fnt | The font used to render the string |
Example
Example 1: Wrap an 16pt string to fit onto a 100px wide window
> (string-split-width "The quick brown fox jumps over the lazy dog." 100 ascii_16.fnt)
("The quick " "brown fox " "jumps over " "the lazy dog.")