diff options
Diffstat (limited to 'webkit/pending/SimpleFontData.cpp')
-rw-r--r-- | webkit/pending/SimpleFontData.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/webkit/pending/SimpleFontData.cpp b/webkit/pending/SimpleFontData.cpp index 54abade..6563196 100644 --- a/webkit/pending/SimpleFontData.cpp +++ b/webkit/pending/SimpleFontData.cpp @@ -234,4 +234,19 @@ float CJKWidthFontData::widthForGlyph(Glyph glyph) const return width; } +// static +// TODO(dglazkov): Move to Font::isCJKCodePoint for consistency +bool SimpleFontData::isCJKCodePoint(UChar32 c) +{ + // AC00..D7AF; Hangul Syllables + if ((0xAC00 <= c) && (c <= 0xD7AF)) + return true; + + // CJK ideographs + UErrorCode errorCode; + return uscript_getScript(c, &errorCode) == USCRIPT_HAN && + U_SUCCESS(errorCode); +} + + } // namespace WebCore |