What if i have custom unicode characters? The Image Font (if you are talking about your another topic) only supports single-byte characters as its glyphs data. This has not been updated last time when I glanced at the code. So I think you need to wait for a bit longer. Or you can try ttf instead. O...
Yeah, you are right. But I'm using ttf, so things get a bit more complex (the font is not monospace, so probably I have to 'force' it to be by drawing the characters one by one). For example, I want a certain word to be displayed in red. I guess I have to break down the sentence to characters, unles...
Well that depends on what you are working on. If you are dealing with a string cosntant, then there's no problem and your method should be faster than the iterator(maybe) function. I want the game to display a dialogue (like many 2D RPGs do, a box plus some strings), but additionally, I don't want t...
I don't think that always works, if the character is utf-8 encoded (for example that ÿ takes 2 bytes and any Chinese character takes 3 bytes). I figured it out a minute ago though: function utf8iterate(str) return string.gfind(str, "([%z\1-\127\194-\244][\128-\191]*)") end ...blahblah loca...
May I ask a related question? Since we have utf-8 support now, how to get a single character from a utf-8 string? The lua function string.byte doesn't work obviously. --- Edit* OK, I just found a long article about that on the lua site. It appears there's no easy way, except interpreting the string ...