whiteboxdev / library-defold-typewriter

Defold Typewriter provides text scrolling and styling in a Defold game engine project.
zlib License
26 stars 2 forks source link

Special characters not shown correctly #1

Open hus7 opened 1 year ago

hus7 commented 1 year ago

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.

octplane commented 4 months ago

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.

whiteboxdev commented 4 months ago

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.

skittonik commented 3 months ago

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"