-Link of the issue in github:
https://github.com/MetalES/Project-Zelda/issues/46(Note that I have not worked directly on the code to solve this problem.)
Summary of what we already know: our current scripts only work correctly for monospaced fonts with no multi-byte characters (accents and other characters, like Japanese characters, are giving problems since their lenght is not gotten correctly with Lua functions like "string:lenght()", etc).
-Christopho suggested to use "text_surface:get_size()". I didn't understand what he meant at that moment, but now I think I understand what he meant, and his idea is probably the solution that may solve this problem. Of course, part of the code has to be rewritten in a different manner. At first I thought that the size of a text surface was something fixed, like a bounding box, but that's not true, since the API says: "The size is determined by the text and the font".
I think we have two possibilities:
1) One solution should be to get the position and size of the last text surface to obtain the position of the new text surface to be created (when we make a color change).
2) Another solution is to get the size of the text surface and use it to compute the number of spaces that we need to add in the other overlapping surfaces.
Remark: The second solution may be slightly simpler, maybe, but for that one we need to know before the size of a space character, which may depend on the font and size. An easy way to get this is to compute it once (maybe when the script is started), which can be done in this way: create a text surface, write a space, get the size, and then destroy the surface.
@MetalZelda: if you have time these days, could you try some of these two solutions to test if this solves the problem?