static const unsigned short TEXT_LINE_SEPARATOR = 0x2028;
static const unsigned short TEXT_PARAGRAPH_SEPARATOR = 0x2029;
static const unsigned short TEXT_TAB_CHARACTER = 0x09;
+static const unsigned short TEXT_JAPANESE_DOT = 0x3001;
+static const unsigned short TEXT_JAPANESE_COMMA = 0x3002;
}}} // Tizen::Graphics::_Text
bool IsChinese(const wchar_t* ch) const;
+ bool IsJapanese(const wchar_t* ch) const;
+
int GetSentenceLength(const wchar_t* pText, int textLength, int& actualLength) const;
int GetWordWrapLength(const wchar_t* pText, int textLength, int& actualLength) const;
return false;
}
+bool
+TextSimple::IsJapanese(const wchar_t* ch) const
+{
+ if (0x3040 <= *ch && *ch <= 0x309F)
+ {
+ return true;
+ }
+
+ if (0x30A0 <= *ch && *ch <= 0x30FF)
+ {
+ return true;
+ }
+
+ return false;
+}
+
result
TextSimple::GetRegion(int textIndex, int textLength, int& width, int& height) const
{
pText++;
}
+ bool hasFirstDot = false;
int length = textLength;
actualLength = textLength;
return TEXT_RETBY_NORMAL;
}
+ if ((*pText == TEXT_JAPANESE_DOT || *pText == TEXT_JAPANESE_COMMA)
+ && (IsChinese(pLastCharacter) || IsJapanese(pLastCharacter)))
+ {
+ hasFirstDot = true;
+ }
+
if (*pText == TEXT_OBJ_CHARACTER)
{
return TEXT_RETBY_NORMAL;
if (actualLength == 0)
{
+ if (hasFirstDot == true)
+ {
+ actualLength = textLength - 1;
+ }
+
return TEXT_RETBY_LIMITLENGTH;
}