Dear ImGui notes


ImGui works fine with Unicode fonts, I believe it works for at least all languages which can be written from left to right. Not so sure about Arabic and Hebrew.

Google’s NOTO fonts can be downloaded from as one big zip file. Here only one of the files within zip is needed, I picked up NotoSansDisplay-Regular.ttf.

Use something like io.Fonts->AddFontFromFileTTF(“/coderoot/bluetree/egui/fonts/NotoSansDisplay-Regular.ttf”, 20.0f, NULL, io.Fonts->GetGlyphRangesCyrillic()); to load the Cyrillic glyphs to ImGui (latin ones are loaded by default).

If Russian string literals are needed within C/C++ code, portable way is to code these as escape sequences: const char myrussiantext[] = “xd0xbcxd0xb0xd1x82xd0xb5xd1x80xd0xb8xd0xbdxd1x81xd0xbaxd0xb0xd1x8fx20xd0xbdxd0xbexd1x87xd1x8c”;

Tool to convert Unicode text (Chinese, Russian, etc.) to C escape sequences: Select “use bytes”, UTF8 and no separator. The escaped unicode can be copy/pasted into code.


“Russian text by Dear ImGui”.

210417, updated 17.3.2021/pekka