1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-12 02:00:58 +01:00

Tidying up & Chinese glyph range includes missing punctuation.

This commit is contained in:
ocornut 2015-03-08 13:28:44 +00:00
parent 79ddddd910
commit afc23a5617

View File

@ -7559,8 +7559,7 @@ const ImWchar* ImFontAtlas::GetGlyphRangesChinese()
static const ImWchar ranges[] = static const ImWchar ranges[] =
{ {
0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x3000, 0x3000, // Ideographic Space 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana
0x3040, 0x30FF, // Hiragana, Katakana
0x31F0, 0x31FF, // Katakana Phonetic Extensions 0x31F0, 0x31FF, // Katakana Phonetic Extensions
0xFF00, 0xFFEF, // Half-width characters 0xFF00, 0xFFEF, // Half-width characters
0x4e00, 0x9FAF, // CJK Ideograms 0x4e00, 0x9FAF, // CJK Ideograms
@ -7609,11 +7608,10 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
109,2,18,23,0,0,9,61,3,0,28,41,77,27,19,17,81,5,2,14,5,83,57,252,14,154,263,14,20,8,13,6,57,39,38, 109,2,18,23,0,0,9,61,3,0,28,41,77,27,19,17,81,5,2,14,5,83,57,252,14,154,263,14,20,8,13,6,57,39,38,
}; };
static int ranges_unpacked = false; static int ranges_unpacked = false;
static ImWchar ranges[10 + IM_ARRAYSIZE(offsets_from_0x4E00)*2 + 1] = static ImWchar ranges[8 + IM_ARRAYSIZE(offsets_from_0x4E00)*2 + 1] =
{ {
0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x3000, 0x303F, // Ideographic Space, Japanese Punctuations 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana
0x3040, 0x30FF, // Hiragana, Katakana
0x31F0, 0x31FF, // Katakana Phonetic Extensions 0x31F0, 0x31FF, // Katakana Phonetic Extensions
0xFF00, 0xFFEF, // Half-width characters 0xFF00, 0xFFEF, // Half-width characters
}; };
@ -7621,7 +7619,7 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
{ {
// Unpack // Unpack
int codepoint = 0x4e00; int codepoint = 0x4e00;
ImWchar* dst = &ranges[10]; ImWchar* dst = &ranges[8];
for (int n = 0; n < IM_ARRAYSIZE(offsets_from_0x4E00); n++, dst += 2) for (int n = 0; n < IM_ARRAYSIZE(offsets_from_0x4E00); n++, dst += 2)
dst[0] = dst[1] = (ImWchar)(codepoint += (offsets_from_0x4E00[n] + 1)); dst[0] = dst[1] = (ImWchar)(codepoint += (offsets_from_0x4E00[n] + 1));
dst[0] = 0; dst[0] = 0;