Skip to content

string split width rtl

Chris Petersen edited this page Oct 16, 2014 · 1 revision

string-split-width-rtlreturns a modified version of string str (which is in right to left case) 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. This procedure assumes the text is read right to left and so the (right) end of the string is in the first item in the list (first line) and the left (start) of the string is in the last item in the list (last 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 right to left

> (string-split-width-rtl ".god yzal eht revo spmuj xof nworb kciuq ehT" 100 ascii16.fnt)
(" kciuq ehT" " xof nworb" " revo spmuj"  ".god yzal eht")
Clone this wiki locally