- TextLabel& impl( GetImpl( label ) );
- switch( index )
- {
- case Toolkit::TextLabel::Property::RENDERING_BACKEND:
- {
- int backend = value.Get< int >();
-
-#ifndef ENABLE_VECTOR_BASED_TEXT_RENDERING
- if( Text::RENDERING_VECTOR_BASED == backend )
- {
- backend = TextAbstraction::BITMAP_GLYPH; // Fallback to bitmap-based rendering
- }
-#endif
- if( impl.mRenderingBackend != backend )
- {
- impl.mRenderingBackend = backend;
- impl.mRenderer.Reset();
-
- if( impl.mController )
- {
- // When using the vector-based rendering, the size of the GLyphs are different
- TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == impl.mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
- impl.mController->SetGlyphType( glyphType );
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::TEXT:
- {
- if( impl.mController )
- {
- impl.mController->SetText( value.Get< std::string >() );
- }
- break;
- }
- case Toolkit::TextLabel::Property::FONT_FAMILY:
- {
- if( impl.mController )
- {
- const std::string fontFamily = value.Get< std::string >();
-
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::SetProperty Property::FONT_FAMILY newFont(%s)\n", fontFamily.c_str() );
- impl.mController->SetDefaultFontFamily( fontFamily );
- }
- break;
- }
- case Toolkit::TextLabel::Property::FONT_STYLE:
- {
- SetFontStyleProperty( impl.mController, value, Text::FontStyle::DEFAULT );
- break;
- }
- case Toolkit::TextLabel::Property::POINT_SIZE:
- {
- if( impl.mController )
- {
- const float pointSize = value.Get< float >();
-
- if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
- {
- impl.mController->SetDefaultPointSize( pointSize );
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::MULTI_LINE:
- {
- if( impl.mController )
- {
- impl.mController->SetMultiLineEnabled( value.Get< bool >() );
- }
- break;
- }
- case Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT:
- {
- if( impl.mController )
- {
- LayoutEngine::HorizontalAlignment alignment( LayoutEngine::HORIZONTAL_ALIGN_BEGIN );
- if( Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::HorizontalAlignment >( value.Get< std::string >().c_str(),
- HORIZONTAL_ALIGNMENT_STRING_TABLE,
- HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
- alignment ) )
- {
- impl.mController->SetHorizontalAlignment( alignment );
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT:
- {
- if( impl.mController )
- {
- LayoutEngine::VerticalAlignment alignment( LayoutEngine::VERTICAL_ALIGN_BOTTOM );
- if( Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::VerticalAlignment >( value.Get< std::string >().c_str(),
- VERTICAL_ALIGNMENT_STRING_TABLE,
- VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
- alignment ) )
- {
- impl.mController->SetVerticalAlignment( alignment );
- }
- }
- break;
- }
-
- case Toolkit::TextLabel::Property::TEXT_COLOR:
- {
- if( impl.mController )
- {
- const Vector4 textColor = value.Get< Vector4 >();
- if( impl.mController->GetTextColor() != textColor )
- {
- impl.mController->SetTextColor( textColor );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
-
- case Toolkit::TextLabel::Property::SHADOW_OFFSET:
- {
- if( impl.mController )
- {
- const Vector2 shadowOffset = value.Get< Vector2 >();
- if ( impl.mController->GetShadowOffset() != shadowOffset )
- {
- impl.mController->SetShadowOffset( shadowOffset );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::SHADOW_COLOR:
- {
- if( impl.mController )
- {
- const Vector4 shadowColor = value.Get< Vector4 >();
- if ( impl.mController->GetShadowColor() != shadowColor )
- {
- impl.mController->SetShadowColor( shadowColor );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
- {
- if( impl.mController )
- {
- const Vector4 color = value.Get< Vector4 >();
- if ( impl.mController->GetUnderlineColor() != color )
- {
- impl.mController->SetUnderlineColor( color );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
- {
- if( impl.mController )
- {
- const bool enabled = value.Get< bool >();
- if ( impl.mController->IsUnderlineEnabled() != enabled )
- {
- impl.mController->SetUnderlineEnabled( enabled );
- impl.mRenderer.Reset();
- }
- }
- break;
- }