library-defold-typewriter icon indicating copy to clipboard operation
library-defold-typewriter copied to clipboard

Special characters not shown correctly

Open hus7 opened this issue 2 years ago • 3 comments

Special characters for example ä,ö,ü etc. are not displayed correctly.

The font I am using supports these characters and the 'All Characters' checkbox is enabled in the font settings.

hus7 avatar Aug 15 '23 13:08 hus7

The library uses ASCII string encoding and not utf-8 and thus will break on utf-8 encoded content. It's possible to support utf-8 but then this library will depend on another one for the parsing of these strings. Not sure if @whiteboxdev would like that kind of burden.

octplane avatar Jun 07 '24 20:06 octplane

I think it would be okay to add a dependency to parse UTF-8 strings, but since it's not something that I'm personally interested in, I will leave it to a pull request instead.

whiteboxdev avatar Jun 08 '24 00:06 whiteboxdev

Special characters for example ä,ö,ü etc. are not displayed correctly.

The font I am using supports these characters and the 'All Characters' checkbox is enabled in the font settings.

  1. Add UTF8 module to the dependencies https://github.com/d954mas/defold-utf8/archive/master.zip
  2. In the "typewriter.load" function, replace all "string.sub" to "utf8.sub" and "string.find" to "utf8.find"

skittonik avatar Jul 12 '24 13:07 skittonik