X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fmulti-language-support-impl.cpp;h=f24d42716182487d6238657150bb11ddc15ef90b;hp=52f2b184b9d2e3d6b6caa5b7910e6403a710030a;hb=1621192f7b42f1fa210d6bdf12d853629304bea3;hpb=45ad62cd772319bc585a48c868b31892881374bb diff --git a/dali-toolkit/internal/text/multi-language-support-impl.cpp b/dali-toolkit/internal/text/multi-language-support-impl.cpp index 52f2b18..f24d427 100644 --- a/dali-toolkit/internal/text/multi-language-support-impl.cpp +++ b/dali-toolkit/internal/text/multi-language-support-impl.cpp @@ -205,9 +205,9 @@ void MultilanguageSupport::SetScripts(const Vector& text, currentScriptRun.isRightToLeft = false; // Traverse all characters and set the scripts. - const Length lastCharacter = startIndex + numberOfCharacters; + const Length lastCharacter = startIndex + numberOfCharacters - 1u; - for(Length index = startIndex; index < lastCharacter; ++index) + for(Length index = startIndex; index <= lastCharacter; ++index) { Character character = *(textBuffer + index); @@ -223,7 +223,7 @@ void MultilanguageSupport::SetScripts(const Vector& text, // script of the first character of the paragraph with a defined script. // Skip those characters valid for many scripts like white spaces or '\n'. - bool endOfText = index == lastCharacter; + bool endOfText = index > lastCharacter; //Handle all Emoji Sequence cases if(IsNewSequence(textBuffer, currentScriptRun.script, index, lastCharacter, script)) @@ -280,7 +280,7 @@ void MultilanguageSupport::SetScripts(const Vector& text, // Get the next character. ++index; - endOfText = index == lastCharacter; + endOfText = index > lastCharacter; if(!endOfText) { character = *(textBuffer + index); @@ -471,8 +471,8 @@ void MultilanguageSupport::ValidateFonts(const Vector& FontId previousEmojiFontId = 0u; TextAbstraction::Script previousScript = TextAbstraction::UNKNOWN; - CharacterIndex lastCharacter = startIndex + numberOfCharacters; - for(Length index = startIndex; index < lastCharacter; ++index) + CharacterIndex lastCharacter = startIndex + numberOfCharacters - 1u; + for(Length index = startIndex; index <= lastCharacter; ++index) { // Get the current character. const Character character = *(textBuffer + index); @@ -542,7 +542,7 @@ void MultilanguageSupport::ValidateFonts(const Vector& } bool isCommonScript = false; - bool isEmojiScript = TextAbstraction::IsEmojiScript(script) || TextAbstraction::IsEmojiColorScript(script) || TextAbstraction::IsEmojiTextScript(script); + bool isEmojiScript = TextAbstraction::IsOneOfEmojiScripts(script); if(isEmojiScript && (previousScript == script)) { @@ -628,6 +628,7 @@ void MultilanguageSupport::ValidateFonts(const Vector& { // Use the cached default font for the script if there is one. fontId = cachedDefaultFontId; + isValidFont = true; } else { @@ -660,6 +661,7 @@ void MultilanguageSupport::ValidateFonts(const Vector& } } defaultFontsPerScript->Cache(currentFontDescription, fontId); + isValidFont = true; } } } // !isValidFont (3) @@ -729,6 +731,15 @@ void MultilanguageSupport::ValidateFonts(const Vector& description.path.c_str()); } #endif + if(!isValidFont && !isCommonScript) + { + Dali::TextAbstraction::FontDescription descriptionForLog; + fontClient.GetDescription(fontId, descriptionForLog); + DALI_LOG_RELEASE_INFO("Validated font set fail : Character : %x, Script : %s, Font : %s \n", + character, + Dali::TextAbstraction::ScriptName[script], + descriptionForLog.path.c_str()); + } // Whether bols style is required. isBoldRequired = (currentFontDescription.weight >= TextAbstraction::FontWeight::BOLD);