mirror of
https://github.com/memononen/nanovg
synced 2026-09-26 16:19:07 +03:00
Better support for CJK characters.
Previously, the Unicode range of the CJK chractaters only includes Chinese charactaters, Japanese Kanji, and CJK Symbols and Punctuation. The range are used by traditioanl Korean as well. This commit further includes Hiragana and Katakana in Japanese, and Hangul Syllables and Hangul Jamo in Korean to make CJK support more complete.
This commit is contained in:
parent
d9e8daf46f
commit
7cd8decef4
1 changed files with 6 additions and 1 deletions
|
|
@ -2617,7 +2617,12 @@ int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, floa
|
|||
type = NVG_NEWLINE;
|
||||
break;
|
||||
default:
|
||||
if (iter.codepoint >= 0x4E00 && iter.codepoint <= 0x9FFF)
|
||||
if (iter.codepoint >= 0x4E00 && iter.codepoint <= 0x9FFF ||
|
||||
iter.codepoint >= 0x3000 && iter.codepoint <= 0x30FF ||
|
||||
iter.codepoint >= 0xFF00 && iter.codepoint <= 0xFFEF ||
|
||||
iter.codepoint >= 0x1100 && iter.codepoint <= 0x11FF ||
|
||||
iter.codepoint >= 0x3130 && iter.codepoint <= 0x318F ||
|
||||
iter.codepoint >= 0xAC00 && iter.codepoint <= 0xD7AF)
|
||||
type = NVG_CJK_CHAR;
|
||||
else
|
||||
type = NVG_CHAR;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue