You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all I would like to say thanks to all of your hard word on this library.
I got problem when trying to display Vietnamese font. I used your tool Create_font.pde to create font header file.
However, the unicode character is broken on the screen.
Could you please help to check if I missed something?
Here is my code and font file, the string is "Việt Nam" and the unicode character is U1EC7:
So I managed to draw Vietnamese characters on the screen. However, there are some curious points that I want to share with you guys and hopely I can understand them deeply.
Previously, I wrongly generated *.vlw file using Processing project. I didnot specify unicode blocks area. So I tried to find what unicode block that Vietnamese font is. According to this link, it turns out that the font is listed in several noncontiguous Unicode ranges.
Then I found an online tool to analyze font file Font Drop. The tool shows that the font is listed in 2 parts, basic latin from 0x20 to 0x7E, and Unicode characters from 0xA0 to 0xFE
After that, I specified the Unicode blocks in Processing project in Custom range area. Finally, the *.vlw file is generated properly.
My question is, Is there a more convenient way to identify the unicode block from the font either than using above online tool?
However, I cannot draw the text that is defined directly in Arduino IDE 1.8.19 using this:
Stringvietnamese_str="Việt Nam";
tft.drawString(vietnamese_str, 0); //Not work - broken character
The problem is, my font file is encoded to Latin-1 and the library only support Unicode (correct me if I'm wrong)
My question is, is there a way to change decoding method to other than Unicode?
Ok, so my solution is to use drawGlyph instead and it's working very very well except one thing. That is, I have to define the string as a char array instead of a string, and draw the characters one by one in a loop like this:
Also, due to draw character one by one, I need to calculate the text width manually to draw in a center alignment. I used tft.textWidth(text); but it returns incorrect width. The returned value is less than the actual printing.
Is there a way to calculate exact text width with smooth font?
Hi Bodmer,
First of all I would like to say thanks to all of your hard word on this library.
I got problem when trying to display Vietnamese font. I used your tool Create_font.pde to create font header file.
However, the unicode character is broken on the screen.
Could you please help to check if I missed something?
Here is my code and font file, the string is "Việt Nam" and the unicode character is U1EC7:
https://github.com/humacompany/tft_espi_vietnamese_font
Thank you and best regards,
Manh
The text was updated successfully, but these errors were encountered: