- const std::string style = value.Get< std::string >();
- DALI_LOG_INFO( gLogFilter, Debug::General, "Text Control %p FONT_STYLE %s\n", controller.Get(), style.c_str() );
+ const std::string fontFamilyValue = value.Get<std::string>();
+
+ if( fontFamilyValue.empty() )
+ {
+ // Resets the default's font family name.
+ controller->SetDefaultFontFamily( "" );
+ return;
+ }
+
+ Property::Map map;
+ ParsePropertyString( fontFamilyValue, map );
+
+ if( map.Empty() )
+ {
+ // There is no map. The font has been passed as a font's family name with no format.
+ controller->SetDefaultFontFamily( fontFamilyValue );
+ }
+ else
+ {
+ /// Family key
+ Property::Value* familyValue = map.Find( FAMILY_KEY );
+
+ std::string fontFamilyName;
+ if( NULL != familyValue )
+ {
+ fontFamilyName = familyValue->Get<std::string>();
+ }
+
+ /// Type key
+ Property::Value* typeValue = map.Find( TYPE_KEY );
+
+ std::string typeStr;
+ if( NULL != typeValue )
+ {
+ typeStr = typeValue->Get<std::string>();
+ }
+
+ if( TokenComparison( SYSTEM_TOKEN, typeStr.c_str(), typeStr.size() ) )
+ {
+ controller->UpdateAfterFontChange( fontFamilyName );
+ }
+ else
+ {
+ controller->SetDefaultFontFamily( fontFamilyName );
+ }
+ }
+ }
+}