2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/event/actors/text-actor-impl.h>
22 #include <dali/public-api/object/type-registry.h>
23 #include <dali/public-api/text/text-actor-parameters.h>
24 #include <dali/integration-api/platform-abstraction.h>
25 #include <dali/integration-api/debug.h>
26 #include <dali/internal/common/core-impl.h>
27 #include <dali/internal/event/actor-attachments/text-attachment-impl.h>
28 #include <dali/internal/event/common/property-helper.h>
29 #include <dali/internal/event/text/font-impl.h>
30 #include <dali/internal/event/text/text-impl.h>
31 #include <dali/internal/event/text/utf8-impl.h>
44 // Name Type writable animatable constraint-input enum for index-checking
45 DALI_PROPERTY_TABLE_BEGIN
46 DALI_PROPERTY( "text", STRING, true, false, true, Dali::TextActor::Property::Text )
47 DALI_PROPERTY( "font", STRING, true, false, true, Dali::TextActor::Property::Font )
48 DALI_PROPERTY( "font-style", STRING, true, false, true, Dali::TextActor::Property::FontStyle )
49 DALI_PROPERTY( "outline-enable", BOOLEAN, true, false, true, Dali::TextActor::Property::OutlineEnable )
50 DALI_PROPERTY( "outline-color", VECTOR4, true, false, true, Dali::TextActor::Property::OutlineColor )
51 DALI_PROPERTY( "outline-thickness-width", VECTOR2, true, false, true, Dali::TextActor::Property::OutlineThicknessWidth )
52 DALI_PROPERTY( "smooth-edge", FLOAT, true, false, true, Dali::TextActor::Property::SmoothEdge )
53 DALI_PROPERTY( "glow-enable", BOOLEAN, true, false, true, Dali::TextActor::Property::GlowEnable )
54 DALI_PROPERTY( "glow-color", VECTOR4, true, false, true, Dali::TextActor::Property::GlowColor )
55 DALI_PROPERTY( "glow-intensity", FLOAT, true, false, true, Dali::TextActor::Property::GlowIntensity )
56 DALI_PROPERTY( "shadow-enable", BOOLEAN, true, false, true, Dali::TextActor::Property::ShadowEnable )
57 DALI_PROPERTY( "shadow-color", VECTOR4, true, false, true, Dali::TextActor::Property::ShadowColor )
58 DALI_PROPERTY( "shadow-offset", VECTOR2, true, false, true, Dali::TextActor::Property::ShadowOffset )
59 DALI_PROPERTY( "italics-angle", FLOAT, true, false, true, Dali::TextActor::Property::ItalicsAngle )
60 DALI_PROPERTY( "underline", BOOLEAN, true, false, true, Dali::TextActor::Property::Underline )
61 DALI_PROPERTY( "weight", INTEGER, true, false, true, Dali::TextActor::Property::Weight )
62 DALI_PROPERTY( "font-detection-automatic", BOOLEAN, true, false, true, Dali::TextActor::Property::FontDetectionAutomatic )
63 DALI_PROPERTY( "gradient-color", VECTOR4, true, false, true, Dali::TextActor::Property::GradientColor )
64 DALI_PROPERTY( "gradient-start-point", VECTOR2, true, false, true, Dali::TextActor::Property::GradientStartPoint )
65 DALI_PROPERTY( "gradient-end-point", VECTOR2, true, false, true, Dali::TextActor::Property::GradientEndPoint )
66 DALI_PROPERTY( "shadow-size", FLOAT, true, false, true, Dali::TextActor::Property::ShadowSize )
67 DALI_PROPERTY( "text-color", VECTOR4, true, false, true, Dali::TextActor::Property::TextColor )
68 DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
72 const char* const SIGNAL_TEXT_LOADING_FINISHED = "text-loading-finished";
76 return Dali::TextActor::New();
79 TypeRegistration mType( typeid( Dali::TextActor ), typeid( Dali::RenderableActor ), Create );
81 SignalConnectorType s1( mType, SIGNAL_TEXT_LOADING_FINISHED, &TextActor::DoConnectSignal );
85 TextActorPtr TextActor::New( const Integration::TextArray& utfCodes, const TextActorParameters& parameters )
87 // first stage construction
88 TextActorPtr actor ( new TextActor( parameters.IsAutomaticFontDetectionEnabled() ) );
90 const TextStyle& style = parameters.GetTextStyle();
92 FontPointer fontPtr( Font::New(style.GetFontName(), style.GetFontStyle(), style.GetFontPointSize() ) );
94 // Second-phase construction
97 //create the attachment
98 actor->mTextAttachment = TextAttachment::New( *actor->mStage, *actor->mNode, Integration::TextArray(), fontPtr );
99 actor->Attach(*actor->mTextAttachment);
101 // Note: SetTextStyle() MUST be called before SetText(), to ensure
102 // that a single ResourceRequest for the glyphs is made. Calling
103 // them in the wrong order will issue two requests.
104 actor->SetTextStyle( style, DONT_REQUEST_NEW_TEXT );
106 actor->SetText( utfCodes );
111 TextActor::TextActor(bool fontDetection)
113 mLoadingState(Dali::ResourceLoading),
114 mUsingNaturalSize(true),
115 mInternalSetSize(false),
116 mFontDetection(fontDetection),
121 void TextActor::OnInitialize()
125 TextActor::~TextActor()
127 StopObservingTextLoads();
130 const std::string TextActor::GetText() const
132 const Integration::TextArray& utfCodes = mTextAttachment->GetText();
136 const std::size_t length = utfCodes.Count();
137 // minimize allocations for ascii strings
138 text.reserve( length );
140 for (unsigned int i = 0; i < length; ++i)
142 unsigned char utf8Data[4];
143 unsigned int utf8Length;
145 utf8Length = UTF8Write(utfCodes[i], utf8Data);
147 text.append(reinterpret_cast<const char*>(utf8Data), utf8Length);
153 Font* TextActor::GetFont() const
155 return &mTextAttachment->GetFont();
158 void TextActor::SetToNaturalSize()
160 // ignore size set by application
161 mUsingNaturalSize = true;
162 TextChanged(); // this will calculate natural size
165 void TextActor::StopObservingTextLoads()
169 mTextAttachment->GetFont().RemoveObserver( *this );
174 void TextActor::StartObservingTextLoads()
178 mTextAttachment->GetFont().AddObserver( *this );
183 void TextActor::SetText(const Integration::TextArray& utfCodes)
185 StopObservingTextLoads();
187 // assign the new text
188 mTextAttachment->SetText(utfCodes);
192 // first check if the provided font supports the text
194 if( !mTextAttachment->GetFont().AllGlyphsSupported(utfCodes) )
197 // @todo GetFamilyForText should return font name and style
198 const std::string fontName = Font::GetFamilyForText(utfCodes);
200 // use previous formatting
201 Internal::Font& font = mTextAttachment->GetFont();
203 Dali::Font fontNew = Dali::Font::New( Dali::FontParameters( fontName, font.GetStyle(), PointSize(font.GetPointSize() ) ) );
205 SetFont( GetImplementation(fontNew), DONT_REQUEST_NEW_TEXT );
212 void TextActor::SetFont(Font& font, TextRequestMode mode )
214 StopObservingTextLoads();
216 if( mode == REQUEST_NEW_TEXT )
219 mTextAttachment->SetFont( font );
221 // request text for new font
227 mTextAttachment->SetFont( font );
231 Vector3 TextActor::GetNaturalSize() const
233 Vector2 naturalSize( mTextAttachment->GetNaturalTextSize() );
234 return Vector3( naturalSize.width, naturalSize.height, CalculateSizeZ( naturalSize ) );
237 void TextActor::OnSizeSet(const Vector3& targetSize)
239 if( !mInternalSetSize )
241 // after size is once set by application we no longer use the natural size
242 mUsingNaturalSize = false;
246 void TextActor::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
248 // after size has been animated by application we no longer use the natural size
249 mUsingNaturalSize = false;
252 RenderableAttachment& TextActor::GetRenderableAttachment() const
254 DALI_ASSERT_DEBUG( mTextAttachment );
255 return *mTextAttachment;
258 void TextActor::SetGradientColor( const Vector4& color )
260 mTextAttachment->SetGradient( color, mTextAttachment->GetGradientStartPoint(), mTextAttachment->GetGradientEndPoint() );
263 const Vector4& TextActor::GetGradientColor() const
265 return mTextAttachment->GetGradientColor();
268 void TextActor::SetGradientStartPoint( const Vector2& position )
270 mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), position, mTextAttachment->GetGradientEndPoint() );
273 const Vector2& TextActor::GetGradientStartPoint() const
275 return mTextAttachment->GetGradientStartPoint();
278 void TextActor::SetGradientEndPoint( const Vector2& position )
280 mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), mTextAttachment->GetGradientStartPoint(), position );
283 const Vector2& TextActor::GetGradientEndPoint() const
285 return mTextAttachment->GetGradientEndPoint();
288 void TextActor::SetGradient( const Vector4& color, const Vector2& startPoint, const Vector2& endPoint )
290 mTextAttachment->SetGradient( color, startPoint, endPoint );
293 void TextActor::SetTextStyle( const TextStyle& style, TextRequestMode mode )
296 const Font& font = mTextAttachment->GetFont();
298 // Determine the font name/style/size that Font would create.
299 // Then compare this to the existing font (which has been validated by Font).
301 std::string resolvedFontName = style.GetFontName();
302 std::string resolvedFontStyle = style.GetFontStyle();
303 float resolvedFontPointSize = style.GetFontPointSize();
304 bool resolvedFontFamilyDefault(false);
305 bool resolvedFontPointSizeDefault(false);
307 Font::ValidateFontRequest( resolvedFontName,
309 resolvedFontPointSize,
310 resolvedFontFamilyDefault,
311 resolvedFontPointSizeDefault );
313 // Now compare to existing font used to see if a font change is necessary.
314 if( ( font.GetName() != resolvedFontName ) ||
315 ( font.GetStyle() != resolvedFontStyle ) ||
316 ( fabsf(font.GetPointSize() - resolvedFontPointSize) >= GetRangedEpsilon(font.GetPointSize(), resolvedFontPointSize) ) )
318 // Create font with original request (so font can determine if family and/or point size is default)
319 SetFont( *(Font::New( style.GetFontName(), style.GetFontStyle(), style.GetFontPointSize() ) ), mode );
323 if( !style.IsTextColorDefault() )
325 SetTextColor( style.GetTextColor() );
329 mTextAttachment->ResetTextColor();
333 if( !style.IsItalicsDefault() )
335 SetItalics( style.IsItalicsEnabled() ? Radian( style.GetItalicsAngle() ) : Radian( 0.0f ) );
339 mTextAttachment->ResetItalics();
343 if( !style.IsUnderlineDefault() )
345 SetUnderline( style.IsUnderlineEnabled(), style.GetUnderlineThickness(), style.GetUnderlinePosition() );
349 mTextAttachment->ResetUnderline();
353 if( !style.IsShadowDefault() )
355 SetShadow( style.IsShadowEnabled(), style.GetShadowColor(), style.GetShadowOffset(), style.GetShadowSize() );
359 mTextAttachment->ResetShadow();
363 if( !style.IsGlowDefault() )
365 SetGlow( style.IsGlowEnabled(), style.GetGlowColor(), style.GetGlowIntensity() );
369 mTextAttachment->ResetGlow();
373 if( !style.IsSmoothEdgeDefault() )
375 SetSmoothEdge( style.GetSmoothEdge() );
379 mTextAttachment->ResetSmoothEdge();
383 if( !style.IsOutlineDefault() )
385 SetOutline( style.IsOutlineEnabled(), style.GetOutlineColor(), style.GetOutlineThickness() );
389 mTextAttachment->ResetOutline();
393 if( !style.IsFontWeightDefault() )
395 SetWeight( style.GetWeight() );
399 mTextAttachment->ResetWeight();
403 if( !style.IsGradientDefault() )
405 if( style.IsGradientEnabled() )
407 SetGradient( style.GetGradientColor(), style.GetGradientStartPoint(), style.GetGradientEndPoint() );
411 SetGradient( TextStyle::DEFAULT_GRADIENT_COLOR, TextStyle::DEFAULT_GRADIENT_START_POINT, TextStyle::DEFAULT_GRADIENT_END_POINT );
416 mTextAttachment->ResetGradient();
421 TextStyle TextActor::GetTextStyle() const
424 mTextAttachment->GetTextStyle( textStyle );
429 void TextActor::SetTextColor(const Vector4& color)
431 mTextAttachment->SetTextColor( color );
434 Vector4 TextActor::GetTextColor() const
436 return mTextAttachment->GetTextColor();
439 void TextActor::SetSmoothEdge( float smoothEdge )
441 mTextAttachment->SetSmoothEdge(smoothEdge);
444 void TextActor::SetOutline( bool enable, const Vector4& color, const Vector2& offset )
446 mTextAttachment->SetOutline(enable, color, offset);
449 void TextActor::SetGlow( bool enable, const Vector4& color, float intensity )
451 mTextAttachment->SetGlow(enable, color, intensity);
454 void TextActor::SetShadow( bool enable, const Vector4& color, const Vector2& offset, float size )
456 mTextAttachment->SetShadow(enable, color, offset, size);
459 void TextActor::SetItalics( Radian angle )
461 mTextAttachment->SetItalics( angle );
466 bool TextActor::GetItalics() const
468 return mTextAttachment->GetItalics();
471 Radian TextActor::GetItalicsAngle() const
473 return mTextAttachment->GetItalicsAngle();
476 void TextActor::SetUnderline( bool enable, float thickness, float position )
478 mTextAttachment->SetUnderline( enable, thickness, position );
483 bool TextActor::GetUnderline() const
485 return mTextAttachment->GetUnderline();
488 float TextActor::GetUnderlineThickness() const
490 return mTextAttachment->GetUnderlineThickness();
493 float TextActor::GetUnderlinePosition() const
495 return mTextAttachment->GetUnderlinePosition();
498 void TextActor::SetWeight( TextStyle::Weight weight )
500 mTextAttachment->SetWeight( weight );
503 TextStyle::Weight TextActor::GetWeight() const
505 return mTextAttachment->GetWeight();
508 void TextActor::SetFontDetectionAutomatic(bool value)
510 mFontDetection = value;
513 bool TextActor::IsFontDetectionAutomatic() const
515 return mFontDetection;
518 bool TextActor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
520 bool connected( true );
521 TextActor* textActor = dynamic_cast<TextActor*>(object);
523 if( 0 == strcmp( signalName.c_str(), SIGNAL_TEXT_LOADING_FINISHED ) )
525 textActor->TextAvailableSignal().Connect( tracker, functor );
529 // signalName does not match any signal
536 void TextActor::TextLoaded()
538 // if the text is loaded, trigger the loaded finished signal
539 CheckTextLoadState();
542 void TextActor::TextChanged()
544 // this will tell the text attachment to act on any text or font changes
545 mTextAttachment->TextChanged();
547 // check the loading state
548 bool loaded = CheckTextLoadState();
551 mLoadingState = Dali::ResourceLoading;
553 StartObservingTextLoads();
555 // the text natural size is calculated synchronously above, when TextChanged() is called
556 if (mUsingNaturalSize)
558 mInternalSetSize = true; // to know we're internally setting size
559 SetSize( mTextAttachment->GetNaturalTextSize() );
560 mInternalSetSize = false;
564 bool TextActor::CheckTextLoadState()
566 if( mTextAttachment->IsTextLoaded() )
568 mLoadingState = Dali::ResourceLoadingSucceeded;
570 StopObservingTextLoads();
572 // emit text available signal
574 mLoadingFinished.Emit( Dali::TextActor( this ) );
583 unsigned int TextActor::GetDefaultPropertyCount() const
585 return RenderableActor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
588 void TextActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
590 RenderableActor::GetDefaultPropertyIndices( indices ); // RenderableActor class properties
592 indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
594 int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
595 for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
597 indices.push_back( index );
601 const char* TextActor::GetDefaultPropertyName( Property::Index index ) const
603 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
605 return RenderableActor::GetDefaultPropertyName(index) ;
608 index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
609 if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
611 return DEFAULT_PROPERTY_DETAILS[index].name;
614 // Index out-of-bounds.
618 Property::Index TextActor::GetDefaultPropertyIndex(const std::string& name) const
620 Property::Index index = Property::INVALID_INDEX;
622 // Look for name in default properties
623 for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
625 if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // Don't want to convert rhs to string
627 index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
632 // If not found, check in base class
633 if( Property::INVALID_INDEX == index )
635 index = RenderableActor::GetDefaultPropertyIndex( name );
641 bool TextActor::IsDefaultPropertyWritable( Property::Index index ) const
643 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
645 return RenderableActor::IsDefaultPropertyWritable( index ) ;
648 return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].writable;
651 bool TextActor::IsDefaultPropertyAnimatable( Property::Index index ) const
653 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
655 return RenderableActor::IsDefaultPropertyAnimatable( index ) ;
658 return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].animatable;
661 bool TextActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
663 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
665 return RenderableActor::IsDefaultPropertyAConstraintInput( index );
667 return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].constraintInput;
670 Property::Type TextActor::GetDefaultPropertyType( Property::Index index ) const
672 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
674 return RenderableActor::GetDefaultPropertyType( index ) ;
677 index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
678 if( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
680 return DEFAULT_PROPERTY_DETAILS[index].type;
683 // index out-of-bounds
684 return Property::NONE;
687 void TextActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
689 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
691 RenderableActor::SetDefaultProperty( index, propertyValue ) ;
697 case Dali::TextActor::Property::Text:
699 SetText( GetTextArray( Dali::Text( propertyValue.Get<std::string>() ) ) );
702 case Dali::TextActor::Property::Font:
704 SetFont( *Font::New( propertyValue.Get<std::string>(),
705 mTextAttachment->GetFont().GetStyle(),
706 PointSize( mTextAttachment->GetFont().GetPointSize() ) ) );
709 case Dali::TextActor::Property::FontStyle:
711 SetFont( *Font::New( mTextAttachment->GetFont().GetName(),
712 propertyValue.Get<std::string>(),
713 PointSize( mTextAttachment->GetFont().GetPointSize() ) ) );
716 case Dali::TextActor::Property::OutlineEnable:
720 mTextAttachment->GetOutlineParams( color, thickness );
721 mTextAttachment->SetOutline( propertyValue.Get<bool>(), color, thickness );
724 case Dali::TextActor::Property::OutlineColor:
728 mTextAttachment->GetOutlineParams( color, thickness );
729 mTextAttachment->SetOutline( mTextAttachment->GetOutline(), propertyValue.Get<Vector4>(), thickness );
732 case Dali::TextActor::Property::OutlineThicknessWidth:
736 mTextAttachment->GetOutlineParams( color, thickness );
737 mTextAttachment->SetOutline( mTextAttachment->GetOutline(), color, propertyValue.Get<Vector2>() );
740 case Dali::TextActor::Property::SmoothEdge:
742 mTextAttachment->SetSmoothEdge( propertyValue.Get<float>());
745 case Dali::TextActor::Property::GlowEnable:
749 mTextAttachment->GetGlowParams( color, intensity );
750 mTextAttachment->SetGlow( propertyValue.Get<bool>(), color, intensity );
753 case Dali::TextActor::Property::GlowColor:
757 mTextAttachment->GetGlowParams( color, intensity );
758 mTextAttachment->SetGlow( mTextAttachment->GetGlow(), propertyValue.Get<Vector4>(), intensity );
761 case Dali::TextActor::Property::GlowIntensity:
765 mTextAttachment->GetGlowParams( color, intensity );
766 mTextAttachment->SetGlow(mTextAttachment->GetGlow(), color, propertyValue.Get<float>());
769 case Dali::TextActor::Property::ShadowEnable:
774 mTextAttachment->GetShadowParams( color, offset, size );
775 mTextAttachment->SetShadow( propertyValue.Get<bool>(), color, offset, size );
778 case Dali::TextActor::Property::ShadowColor:
783 mTextAttachment->GetShadowParams( color, offset, size );
784 mTextAttachment->SetShadow( mTextAttachment->GetShadow(), propertyValue.Get<Vector4>(), offset, size );
787 case Dali::TextActor::Property::ShadowOffset:
792 mTextAttachment->GetShadowParams( color, offset, size );
793 mTextAttachment->SetShadow( mTextAttachment->GetShadow(), color, propertyValue.Get<Vector2>(), size );
796 case Dali::TextActor::Property::ShadowSize:
801 mTextAttachment->GetShadowParams( color, offset, size );
802 mTextAttachment->SetShadow( mTextAttachment->GetShadow(), color, offset, propertyValue.Get<float>() );
805 case Dali::TextActor::Property::ItalicsAngle:
807 SetItalics( Radian( propertyValue.Get<float>() ) ) ;
810 case Dali::TextActor::Property::Underline:
812 SetUnderline( propertyValue.Get<bool>(), 0.f, 0.f ) ;
815 case Dali::TextActor::Property::Weight:
817 mTextAttachment->SetWeight( static_cast<TextStyle::Weight>( propertyValue.Get<int>() ) ) ;
820 case Dali::TextActor::Property::FontDetectionAutomatic:
822 mFontDetection = propertyValue.Get<bool>() ;
825 case Dali::TextActor::Property::GradientColor:
827 mTextAttachment->SetGradient( propertyValue.Get<Vector4>(), mTextAttachment->GetGradientStartPoint(), mTextAttachment->GetGradientEndPoint() );
830 case Dali::TextActor::Property::GradientStartPoint:
832 mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), propertyValue.Get<Vector2>(), mTextAttachment->GetGradientEndPoint() );
835 case Dali::TextActor::Property::GradientEndPoint:
837 mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), mTextAttachment->GetGradientStartPoint(), propertyValue.Get<Vector2>() );
840 case Dali::TextActor::Property::TextColor:
842 mTextAttachment->SetTextColor( propertyValue.Get<Vector4>() );
847 DALI_LOG_WARNING( "Unknown text set property (%d)\n", index );
855 Property::Value TextActor::GetDefaultProperty( Property::Index index ) const
857 Property::Value ret ;
858 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
860 ret = RenderableActor::GetDefaultProperty( index ) ;
866 case Dali::TextActor::Property::Text:
871 case Dali::TextActor::Property::Font:
873 ret = mTextAttachment->GetFont().GetName();
876 case Dali::TextActor::Property::FontStyle:
878 ret = mTextAttachment->GetFont().GetStyle();
881 case Dali::TextActor::Property::OutlineEnable:
883 ret = mTextAttachment->GetOutline();
886 case Dali::TextActor::Property::OutlineColor:
890 mTextAttachment->GetOutlineParams( color, thickness );
894 case Dali::TextActor::Property::OutlineThicknessWidth:
898 mTextAttachment->GetOutlineParams( color, thickness );
902 case Dali::TextActor::Property::SmoothEdge:
904 ret = mTextAttachment->GetSmoothEdge();
907 case Dali::TextActor::Property::GlowEnable:
909 ret = mTextAttachment->GetGlow();
912 case Dali::TextActor::Property::GlowColor:
915 float intensity( 0.0f );
916 mTextAttachment->GetGlowParams( color, intensity );
920 case Dali::TextActor::Property::GlowIntensity:
923 float intensity( 0.0f );
924 mTextAttachment->GetGlowParams( color, intensity );
928 case Dali::TextActor::Property::ShadowEnable:
930 ret = mTextAttachment->GetShadow();
933 case Dali::TextActor::Property::ShadowColor:
938 mTextAttachment->GetShadowParams( color, offset, size );
942 case Dali::TextActor::Property::ShadowOffset:
947 mTextAttachment->GetShadowParams( color, offset, size );
951 case Dali::TextActor::Property::ShadowSize:
956 mTextAttachment->GetShadowParams( color, offset, size );
960 case Dali::TextActor::Property::ItalicsAngle:
962 ret = static_cast<float>( mTextAttachment->GetItalics() ) ;
965 case Dali::TextActor::Property::Underline:
967 ret = mTextAttachment->GetUnderline() ;
970 case Dali::TextActor::Property::Weight:
972 ret = static_cast<int>( mTextAttachment->GetWeight() );
975 case Dali::TextActor::Property::FontDetectionAutomatic:
977 ret = mFontDetection;
980 case Dali::TextActor::Property::GradientColor:
982 ret = mTextAttachment->GetGradientColor();
985 case Dali::TextActor::Property::GradientStartPoint:
987 ret = mTextAttachment->GetGradientStartPoint();
990 case Dali::TextActor::Property::GradientEndPoint:
992 ret = mTextAttachment->GetGradientEndPoint();
995 case Dali::TextActor::Property::TextColor:
997 ret = mTextAttachment->GetTextColor();
1002 DALI_LOG_WARNING( "Unknown text set property (%d)\n", index );
1006 } // if from base class
1011 } // namespace Internal