From: minho.sun Date: Wed, 17 Jan 2018 06:49:12 +0000 (+0900) Subject: Set proper locale to harfbuzz X-Git-Tag: dali_1.3.8~3^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=af18d92739c27a14887162c006948b16f1d7efdc;hp=a8c746a9b382fff64872106a2c698d228272f56f Set proper locale to harfbuzz Some country have their own cyrillic alphabets. To draw it, DALi should set proper locale to harfbuzz. Change-Id: I84eef22342765ac98a49ee9821f7693856069125 Signed-off-by: minho.sun --- diff --git a/text/dali/internal/text-abstraction/shaping-impl.cpp b/text/dali/internal/text-abstraction/shaping-impl.cpp index 3eb3488..24c542c 100644 --- a/text/dali/internal/text-abstraction/shaping-impl.cpp +++ b/text/dali/internal/text-abstraction/shaping-impl.cpp @@ -29,6 +29,7 @@ #include #include +#include namespace Dali { @@ -194,9 +195,13 @@ struct Shaping::Plugin hb_buffer_set_script( harfBuzzBuffer, SCRIPT_TO_HARFBUZZ[ script ] ); /* see hb-unicode.h */ - hb_buffer_set_language( harfBuzzBuffer, - hb_language_from_string( DEFAULT_LANGUAGE, - DEFAULT_LANGUAGE_LENGTH ) ); + + char* currentLocale = setlocale(LC_MESSAGES,NULL); + + std::istringstream stringStream( currentLocale ); + std::string localeString; + std::getline(stringStream, localeString, '_'); + hb_buffer_set_language( harfBuzzBuffer, hb_language_from_string( localeString.c_str(), localeString.size() ) ); /* Layout the text */ hb_buffer_add_utf32( harfBuzzBuffer, text, numberOfCharacters, 0u, numberOfCharacters );