olikraus / U8g2_for_Adafruit_GFX

Add U8g2 fonts to any Adafruit GFX based graphics library.
Other
112 stars 32 forks source link

Support for new unicode lookup table (was: Missing Unicode charater "Ă" and "ă" on u8g2_font_unifont_t_vietnamese2) #11

Closed vinhtantg closed 5 years ago

vinhtantg commented 5 years ago

I try using font u8g2_font_unifont_t_vietnamese2 to show Vietnamese Unicode Character and I recognize that character Ă and ă never show. Can you help me to fix that problem.

Example : tft.fillScreen(ST77XX_BLACK); u8g2_for_adafruit_gfx.setFontMode(1); // use u8g2 transparent mode (this is default) u8g2_for_adafruit_gfx.setFontDirection(0); // left to right (this is default) u8g2_for_adafruit_gfx.setForegroundColor(ST77XX_WHITE); // apply Adafruit GFX color u8g2_for_adafruit_gfx.setFont(u8g2_font_unifont_t_vietnamese2); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall u8g2_for_adafruit_gfx.setCursor(0,20); // start writing at this position u8g2_for_adafruit_gfx.print(F("Xin chào")); u8g2_for_adafruit_gfx.setCursor(0,40); // start writing at this position u8g2_for_adafruit_gfx.print(F("Ăn uống, văn hóa")); // UTF-8 string with german umlaut chars delay(2000);

The display show : Xin chào n uống, vn hóa

Not show Ă and ă

olikraus commented 5 years ago

Can you provide the unicode number for Ă and ă?

vinhtantg commented 5 years ago

http://vietunicode.sourceforge.net/charset/v3.htm Ă $0102 ă $0103

olikraus commented 5 years ago

I am a little bit confused. Both chars are included: https://github.com/olikraus/u8g2/wiki/fntgrpunifont

https://raw.githubusercontent.com/wiki/olikraus/u8g2/fntpic/u8g2_font_unifont_t_vietnamese1.png#

https://raw.githubusercontent.com/wiki/olikraus/u8g2/fntpic/u8g2_font_unifont_t_vietnamese2.png

olikraus commented 5 years ago

I will takeover the latest u8g2 fonts...

olikraus commented 5 years ago

Also updated the font code to support the new unicode lookup table.