From ba6e4c32e40bd415dca5eed298753354132a236c Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Wed, 28 Sep 2022 08:19:34 -0700 Subject: [PATCH] Added Greek & Coptic glyph range --- imgui.h | 1 + imgui_draw.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/imgui.h b/imgui.h index 0d32389a7def..1b1a092d34b3 100644 --- a/imgui.h +++ b/imgui.h @@ -2781,6 +2781,7 @@ struct ImFontAtlas // NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details. // NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data. IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin + IMGUI_API const ImWchar* GetGlyphRangesGreek(); // Default + Greek and Coptic IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs IMGUI_API const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 27fcd6dbc5ed..00dbe06c7614 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -2821,6 +2821,17 @@ const ImWchar* ImFontAtlas::GetGlyphRangesDefault() return &ranges[0]; } +const ImWchar* ImFontAtlas::GetGlyphRangesGreek() +{ + static const ImWchar ranges[] = + { + 0x0020, 0x00FF, // Basic Latin + Latin Supplement + 0x0370, 0x03FF, // Greek and Coptic + 0, + }; + return &ranges[0]; +} + const ImWchar* ImFontAtlas::GetGlyphRangesKorean() { static const ImWchar ranges[] =