Experience-Monks / three-bmfont-text

renders BMFont files in ThreeJS with word-wrapping
http://jam3.github.io/three-bmfont-text/test/
MIT License
786 stars 169 forks source link

Non-ascii text handling #16

Closed JoeGermuska closed 7 years ago

JoeGermuska commented 7 years ago

I'm a bit of a newb here, so my apologies if I'm missing something. It seems that this library doesn't correctly handle non-ascii text.

I checked out the repo and changed the text in test-3d.js to use both a literal ñ and the unicode escape \u00f1 and in both cases, those characters simply don't appear. I also used the unicode escape \u0065 (e) and that was correctly rendered.

mattdesl commented 7 years ago

This library uses "bitmap fonts" which is a way of storing glyphs in a texture atlas like this:

lato

So you are limited by which glyphs you select for your texture atlas. When exporting with Hiero or a similar tool, you should be able to add characters like 'ñ' to the glyph atlas.

Other features like ligatures, right-to-left text and certain oriental languages are much more difficult to achieve and out of scope of this library. :smile:

JoeGermuska commented 7 years ago

I see. Thank you for the clarification. I was able to use Hiero to make a texture atlas with some of the characters I need.