Add locale property setting 68/189768/4
authorJinho, Lee <jeano.lee@samsung.com>
Wed, 20 Dec 2017 12:04:13 +0000 (21:04 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Fri, 21 Sep 2018 05:40:47 +0000 (05:40 +0000)
In the font-config of the TV, the priority is generally set in the order
of Korean -> Chinese font, but in the case of zh_CN, the priority is set
to Chinese -> Korean.

In the case of EFL and Clutter, font preference policy in Font-Config is
read according to setlocale information when setting font-family.
This part is missing in DALi.

Change-Id: I8d346eed5f7935f57c6c3267ef9e7b6c164fe516

dali/internal/text/text-abstraction/font-client-plugin-impl.cpp

index 8047822..bd4c599 100644 (file)
@@ -1389,6 +1389,13 @@ FcPattern* FontClient::Plugin::CreateFontFamilyPattern( const FontDescription& f
   // add a property to the pattern for the font family
   FcPatternAddString( fontFamilyPattern, FC_FAMILY, reinterpret_cast<const FcChar8*>( fontDescription.family.c_str() ) );
 
+  // add a property to the pattern for local setting.
+  const char* locale = setlocale( LC_MESSAGES, NULL );
+  if( locale != NULL)
+  {
+    FcPatternAddString( fontFamilyPattern, FC_LANG, reinterpret_cast<const FcChar8*>( locale ) );
+  }
+
   int width = FONT_WIDTH_TYPE_TO_INT[fontDescription.width];
   if( width < 0 )
   {