PART 5 - Using Symbols Fonts and MultiLanguage Characters on Ardunio&display

by egocen in Circuits > Arduino

71 Views, 1 Favorites, 0 Comments

PART 5 - Using Symbols Fonts and MultiLanguage Characters on Ardunio&display

Ekran görüntüsü 2025-02-22 211824.png
rectGauge.png

RP2040-zero

2 x GC9a01 round display

MPU6050 6 axis

sound sensor




Connections

rp2dpWmpu.png

We had previously prepared this sketch in part 4. We are continuing on the same sketch.


Using Unicode Fonts, Symbols and Multilangual Characters

u8g2 library is a good option for using fonts and special symbol font with ardunio displays.

its including unifonts for Turkish (Türkçe) characters. Also rich font family for languages like greek, japan, arabic and symbols like emotions, animals and weather.


to use it in ardunio code: we must install add the library before GFX_Library.


#include <U8g2lib.h>

#include <Arduino_GFX_Library.h>


in the code section:

gfx2->setTextSize(3);

gfx2->setFont(u8g2_font_unifont_te);


//choose font family _te (transparent extended font incluse Turkish(Türkçe) set

_te ile biten fontlar Türkçe seti içerir. Örneğin Ş harfi görüntülemek için aşağıdaki tablodan Ş harfinin adresini bulup kodda kullanacağız.

Ş harfi 336/0150 nolu sırada gözüküyor. İlk harf 0150, Ş ye kadar 16bit sayacağız.

150,151,152....159 şapkalı R simgesine denk geliyor. 159dan sonra 16bit 015a,015b,015c,015d,105e ve 015f oluyor.

Dolayısı ile Ş harfi 015e adresine denk geliyor. Kodda kullanmak için:

gfx2->print("\u015eubat"); //direk kodu "\u015e" şeklinde karakter gibi yazıyoruz. Ekrana Şubat gözükecek.




This Library also have rich font families. Check all list from library site.

https://github.com/olikraus/u8g2/wiki/fntgrpunifont#unifont


u8g2_font_unifont_t_greek

u8g2_font_unifont_t_hebrew

u8g2_font_unifont_t_arabic

u8g2_font_unifont_t_emoticons

u8g2_font_unifont_t_animal

u8g2_font_unifont_t_weather


If you want to display Thermometer symbol in weather symbols must find font addres in the font table.

Thermometer sign seems in 48/0030 row. Count it. Corresponds to the 31nd address.

to display it code section:

gfx->setFont(u8g2_font_unifont_t_weather);

gfx->print("\u0031");



To use Santigrad symbol next to C character;

gfx->setFont(u8g2_font_unifont_te);

gfx->setTextSize(2);

gfx->print((int)value); //sensor value

gfx->print(" C\u00b0"); //santigrad symbol Use direct address code like char