#include <harfbuzz/hb-ft.h>
#include <ft2build.h>
+#include <iostream>
namespace Dali
{
HB_SCRIPT_ETHIOPIC,
HB_SCRIPT_OL_CHIKI,
HB_SCRIPT_TAGALOG,
+ HB_SCRIPT_MEETEI_MAYEK,
HB_SCRIPT_UNKNOWN, // EMOJI
HB_SCRIPT_UNKNOWN, // SYMBOLS1
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 );
hb_glyph_info_t* glyphInfo = hb_buffer_get_glyph_infos( harfBuzzBuffer, &glyphCount );
hb_glyph_position_t *glyphPositions = hb_buffer_get_glyph_positions( harfBuzzBuffer, &glyphCount );
const GlyphIndex lastGlyphIndex = glyphCount - 1u;
+
for( GlyphIndex i = 0u; i < glyphCount; )
{
if( rtlDirection )