Browse Source

Merge pull request #338 from olliwang/CJK

Better support for CJK characters.
shared-context
Mikko Mononen GitHub 8 years ago
parent
commit
e12379653e
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/nanovg.c

+ 6
- 1
src/nanovg.c View File

@@ -2617,7 +2617,12 @@ int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, floa
type = NVG_NEWLINE; type = NVG_NEWLINE;
break; break;
default: 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; type = NVG_CJK_CHAR;
else else
type = NVG_CHAR; type = NVG_CHAR;


Loading…
Cancel
Save