Template repo for tiny cross-platform apps that can be modified on phone, tablet or computer.
1{
2 {type='rows', width=800, default={font={size=21}, line_height=35},
3 {type='text', font={size=28}, line_height=50,
4 {'Car@{Lua Carousel} > functions@{functions} > non-English characters',
5 attrs={
6 Car={target='--carousel'},
7 functions={target='--car-fn'},
8 }},
9 },
10 {type='filler', height=15},
11 {type='text',
12 {"Characters are complex. Lua strings are arrays of bytes, but to manage text in a variety of languages it's more convenient to work with em@{Unicode codepoints}.",
13 attrs={
14 em={font={italic=true}},
15 }}},
16 {type='filler', height=15},
17 {type='text', 'my_utf8.offset(text, index)', font={size=24}},
18 {type='text', ' Like utf8.offset, converts index in codepoints to index in bytes.'},
19 {type='text', ' Unlike utf8.offset, throws an error if index is out of bounds.'},
20 {type='filler', height=10},
21 {type='text', 'my_utf8.match_at(text, pos, pattern)', font={size=24}},
22 {type='text', ' Checks if pattern matches text at index pos (counting codepoints)'},
23 {type='filler', height=10},
24 {type='text', 'my_utf8.chars(s, startpos)', font={size=24}},
25 {type='text', ' Returns an iterator over codepoints in s'},
26 {type='filler', height=15},
27 {type='text', 'See also LÖVE > non-English characters.', target='--love-utf8'},
28 }
29}