Added Turkish font support. (#2817)

* Added Turkish font support.

* Fixed Turkish case not including Latin characters.
This commit is contained in:
gir489 2024-03-11 17:39:25 -04:00 committed by GitHub
parent de90e068b9
commit d75664ec3f
3 changed files with 16 additions and 1 deletions

View File

@ -9,7 +9,8 @@ namespace big
CYRILLIC,
KOREAN,
JAPANESE,
TURKISH,
LAST_ALPHABET_TYPE
};
NLOHMANN_JSON_SERIALIZE_ENUM(eAlphabetType, {{eAlphabetType::LATIN, "latin"}, {eAlphabetType::CHINESE, "chinese"}, {eAlphabetType::CYRILLIC, "cyrillic"}, {eAlphabetType::KOREAN, "korean"}, {eAlphabetType::JAPANESE, "japanese"}})
NLOHMANN_JSON_SERIALIZE_ENUM(eAlphabetType, {{eAlphabetType::LATIN, "latin"}, {eAlphabetType::CHINESE, "chinese"}, {eAlphabetType::CYRILLIC, "cyrillic"}, {eAlphabetType::KOREAN, "korean"}, {eAlphabetType::JAPANESE, "japanese"}, {eAlphabetType::TURKISH, "turkish"}})
}

View File

@ -157,6 +157,18 @@ namespace big
return &full_ranges[0];
}
const ImWchar* font_mgr::GetGlyphRangesTurkish()
{
static const ImWchar icons_ranges_Turkish[] = {
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x011E, 0x011F, // G with breve
0x0130, 0x0131, // dotted I
0x015E, 0x015F, // S-cedilla
0,
};
return &icons_ranges_Turkish[0];
}
const ImWchar* font_mgr::get_imgui_alphabet_type()
{
auto& io = ImGui::GetIO();
@ -166,6 +178,7 @@ namespace big
case eAlphabetType::CYRILLIC: return io.Fonts->GetGlyphRangesCyrillic();
case eAlphabetType::JAPANESE: return io.Fonts->GetGlyphRangesJapanese();
case eAlphabetType::KOREAN: return io.Fonts->GetGlyphRangesKorean();
case eAlphabetType::TURKISH: return GetGlyphRangesTurkish();
default:
case eAlphabetType::LATIN: return io.Fonts->GetGlyphRangesDefault();

View File

@ -35,6 +35,7 @@ namespace big
file get_available_font_file_for_alphabet_type();
const ImWchar* GetGlyphRangesChineseSimplifiedOfficial();
const ImWchar* GetGlyphRangesTurkish();
const ImWchar* get_imgui_alphabet_type();
};
}