ttf2mesh icon indicating copy to clipboard operation
ttf2mesh copied to clipboard

Is it possible to convert 2byte txt into STL ?

Open sjhan12 opened this issue 2 years ago • 2 comments

Hi Sergey Fetisov

Thank you for sharing this great code. I am wondering how to convert 2byte txt into STL with your code.

It seems that the code use char(one byte) to find character in TTF.

Please give me some idea to convert 2byte txt like Korean into STL in your code.

Thanks.

Sangjo

sjhan12 avatar Apr 22 '22 07:04 sjhan12

Hello. Did I understand correctly that by 2byte text you mean utf16 encoded text? If so, then you can use the ttf_find_glyph function and then ttf_glyph2mesh to tessellate the glyph. If your text is in utf8 encoding with a two-byte character representation sequence, then you need to convert it to utf16. In that case, the following discussion may help you: https://stackoverflow.com/questions/7153935/how-to-convert-utf-8-stdstring-to-utf-16-stdwstring

fetisov avatar May 20 '22 23:05 fetisov

Thank you for the link. I will try and get back to you.

sjhan12 avatar Jun 01 '22 13:06 sjhan12