+
+int UtcDaliToolkitTextlabelScrollingInterruptedP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelScrollingInterruptedP");
+ TextLabel label = TextLabel::New("Some text to scroll");
+ DALI_TEST_CHECK( label );
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+ Stage::GetCurrent().Add( label );
+ label.SetSize( 360.0f, 20.f );
+ // Turn on all the effects
+ label.SetProperty( TextLabel::Property::MULTI_LINE, false );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+
+ // Render the text.
+ application.SendNotification();
+ application.Render();
+
+ unsigned int actorCount1 = label.GetChildCount();
+ tet_printf("Initial actor count is(%d)\n", actorCount1 );
+
+ try
+ {
+ // Render some text with the shared atlas backend
+ label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+ application.SendNotification();
+ application.Render(2000);
+
+ unsigned int actorCount1 = label.GetChildCount();
+ tet_printf("Actor count after scrolling is(%d)\n", actorCount1 );
+
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
+
+ // Render the text.
+ application.SendNotification();
+ application.Render();
+
+ unsigned int actorCount2 = label.GetChildCount();
+ tet_printf("After changing color the actor count is(%d)\n", actorCount2 );
+
+ DALI_TEST_EQUALS( actorCount1, actorCount2, TEST_LOCATION );
+
+ }
+ catch( ... )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelScrollingN(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelScrollingN");
+
+ TextLabel label = TextLabel::New("Some text to scroll");
+ DALI_TEST_CHECK( label );
+
+ Stage::GetCurrent().Add( label );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // The text scrolling works only on single line text.
+ label.SetProperty( TextLabel::Property::MULTI_LINE, true );
+
+ // Turn on all the effects.
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+
+ // Enable the auto scrolling effect.
+ label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+
+ // The auto scrolling shouldn't be enabled.
+ const bool enabled = label.GetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL ).Get<bool>();
+ DALI_TEST_CHECK( !enabled );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelEllipsis(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelEllipsis");
+
+ TextLabel label = TextLabel::New("Hello world");
+ DALI_TEST_CHECK( label );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ Stage::GetCurrent().Add( label );
+
+ // Turn on all the effects
+ label.SetAnchorPoint( AnchorPoint::CENTER );
+ label.SetParentOrigin( ParentOrigin::CENTER );
+ label.SetSize( 360.0f, 10.f );
+
+ try
+ {
+ // Render the text.
+ application.SendNotification();
+ application.Render();
+ }
+ catch( ... )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world " );
+ label.SetProperty( DevelTextLabel::Property::IGNORE_SPACES_AFTER_TEXT, false );
+ label.SetSize( 400.0f, 10.f );
+
+ try
+ {
+ // Render the text.
+ application.SendNotification();
+ application.Render();
+ }
+ catch( ... )
+ {
+ tet_result(TET_FAIL);
+ }
+
+
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
+ label.SetProperty( DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true );
+ label.SetSize( 400.0f, 10.f );
+
+ try
+ {
+ // Render the text.
+ application.SendNotification();
+ application.Render();
+ }
+ catch( ... )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelTextWrapMode(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelTextWarpMode");
+
+ int lineCount =0 ;
+
+ TextLabel label = TextLabel::New();
+ label.SetSize( 300.0f, 300.f );
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
+ label.SetProperty( TextLabel::Property::MULTI_LINE, true );
+
+
+
+ //label.SetProperty( TextLabel::Property::POINT_SIZE, 18 );
+ Stage::GetCurrent().Add( label );
+
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WORD" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( lineCount, 2, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "CHARACTER" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::WORD );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( lineCount, 2, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::CHARACTER );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( lineCount, 2, TEST_LOCATION );
+
+ tet_infoline( "Ensure invalid string does not change wrapping mode" );
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "InvalidWrapMode" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextLabelColorComponents(void)
+{
+ ToolkitTestApplication application;
+
+ TextLabel label = TextLabel::New();
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::TEXT_COLOR_ALPHA, 0.6f );
+ DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 0.6f, TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< Vector4 >( TextLabel::Property::TEXT_COLOR ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( label.GetProperty< Vector4 >( TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION );
+
+ // Test a transparent text - Rendering should be skipped.
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
+
+ Stage::GetCurrent().Add( label );
+
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable( true );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), true, TEST_LOCATION ); // Should be rendered
+
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::TRANSPARENT );
+
+ drawTrace.Reset();
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), false, TEST_LOCATION ); // Rendering should be skipped
+
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
+
+ drawTrace.Reset();
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), true, TEST_LOCATION ); // Should be rendered again
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelTextStyle01(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelTextStyle Setting Outline after Shadow");
+
+ TextLabel label = TextLabel::New();
+ label.SetSize( 300.0f, 300.f );
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 12 );
+ Stage::GetCurrent().Add( label );
+
+ Property::Map outlineMapSet;
+ Property::Map outlineMapGet;
+
+ outlineMapSet["color"] = Color::BLUE;
+ outlineMapSet["width"] = 2.0f;
+ label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
+
+ application.SendNotification();
+ application.Render();
+
+ Property::Map shadowMapSet;
+ shadowMapSet.Insert( "color", "green" );
+ shadowMapSet.Insert( "offset", "2 2" );
+ shadowMapSet.Insert( "blurRadius", "3" );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
+
+ outlineMapSet["color"] = Color::RED;
+ outlineMapSet["width"] = 0.0f;
+ label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
+
+ application.SendNotification();
+ application.Render();
+
+ outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
+
+ Property::Value* colorValue = outlineMapGet.Find("color");
+
+ bool colorMatched( false );
+
+ if ( colorValue )
+ {
+ Property::Type valueType = colorValue->GetType();
+
+ if ( Property::STRING == valueType )
+ {
+ std::string stringValue;
+ colorValue->Get( stringValue );
+ if ( stringValue == "red" )
+ {
+ colorMatched = true;
+ }
+ }
+ else if ( Property::VECTOR4 == valueType )
+ {
+ Vector4 colorVector4;
+ colorValue->Get( colorVector4 );
+ if ( colorVector4 == Color::RED )
+ {
+ colorMatched = true;
+ }
+ }
+ }
+
+ DALI_TEST_EQUALS( colorMatched, true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelMultiline(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelMultiline");
+
+ TextLabel label = TextLabel::New();
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world Hello world Hello world" );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
+ label.SetProperty( TextLabel::Property::MULTI_LINE, false );
+ Stage::GetCurrent().Add( label );
+
+ application.SendNotification();
+ application.Render();
+
+ int lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( lineCount, 1, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::MULTI_LINE, true );
+
+ application.SendNotification();
+ application.Render();
+
+ lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( true, (lineCount > 1) , TEST_LOCATION );
+
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelTextDirection(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelTextDirection");
+
+ TextLabel label = TextLabel::New();
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
+ Stage::GetCurrent().Add( label );
+
+ // Test LTR text
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
+ // Test RTL text
+ label.SetProperty( TextLabel::Property::TEXT, "ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+ // Test RTL text starting with weak character
+ label.SetProperty( TextLabel::Property::TEXT, "()ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+ // Test RTL text string with emoji and weak character
+ label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 () ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelVerticalLineAlignment(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelVerticalLineAlignment");
+
+ TextLabel label = TextLabel::New();
+
+ label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::TOP );
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 15 );
+ label.SetProperty( TextLabel::Property::LINE_SPACING, 12 );
+ Stage::GetCurrent().Add( label );
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::TOP ), TEST_LOCATION );
+
+ label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::MIDDLE );
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::MIDDLE ), TEST_LOCATION );
+
+ label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::BOTTOM );
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::BOTTOM ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextLabelBitmapFont(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextLabelBitmapFont");
+
+ DevelText::BitmapFontDescription fontDescription;
+ fontDescription.name = "Digits";
+ fontDescription.underlinePosition = 0.f;
+ fontDescription.underlineThickness = 0.f;
+
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0030.png", ":", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0031.png", "0", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0032.png", "1", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0033.png", "2", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0034.png", "3", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0035.png", "4", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0036.png", "5", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0037.png", "6", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0038.png", "7", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0039.png", "8", 34.f, 0.f } );
+ fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u003a.png", "9", 34.f, 0.f } );
+
+ TextAbstraction::BitmapFont bitmapFont;
+ DevelText::CreateBitmapFont( fontDescription, bitmapFont );
+
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.GetFontId( bitmapFont );
+
+ TextLabel label = TextLabel::New();
+
+ label.SetProperty( TextLabel::Property::TEXT, "0123456789:" );
+ label.SetProperty( TextLabel::Property::FONT_FAMILY, "Digits" );
+
+ // The text has been laid out with the bitmap font if the natural size is the sum of all the width (322) and 34 height.
+ DALI_TEST_EQUALS( label.GetNaturalSize(), Vector3(322.f, 34.f, 0.f), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+ Stage::GetCurrent().Add( label );
+
+ application.SendNotification();
+ application.Render();
+
+ // The text has been rendered if the height of the text-label is the height of the line.
+ DALI_TEST_EQUALS( label.GetCurrentSize().height, 34.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int ConvertPointToPixel( float point )
+{
+ unsigned int horizontalDpi = 0u;
+ unsigned int verticalDpi = 0u;
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.GetDpi( horizontalDpi, verticalDpi );
+
+ return ( point * 72.f ) / static_cast< float >( horizontalDpi );
+}
+
+int UtcDaliToolkitTextlabelTextFit(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelTextFit");
+ TextLabel label = TextLabel::New();
+ Vector2 size( 460.0f, 100.0f );
+ label.SetSize( size );
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
+
+ // check point size
+ Property::Map textFitMapSet;
+ textFitMapSet["enable"] = true;
+ textFitMapSet["minSize"] = 10.f;
+ textFitMapSet["maxSize"] = 100.f;
+ textFitMapSet["stepSize"] = -1.f;
+ textFitMapSet["fontSizeType"] = "pointSize";
+
+ label.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMapSet );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 120.f);
+
+ Stage::GetCurrent().Add( label );
+
+ application.SendNotification();
+ application.Render();
+
+ const Vector3 EXPECTED_NATURAL_SIZE( 460.0f, 98.0f, 0.0f );
+ DALI_TEST_EQUALS( EXPECTED_NATURAL_SIZE, label.GetNaturalSize(), TEST_LOCATION );
+
+ // check pixel size
+ textFitMapSet.Clear();
+ textFitMapSet["enable"] = true;
+ textFitMapSet["minSize"] = ConvertPointToPixel( 10.f );
+ textFitMapSet["maxSize"] = ConvertPointToPixel( 100.f );
+ textFitMapSet["stepSize"] = ConvertPointToPixel ( 1.f );
+ textFitMapSet["fontSizeType"] = "pixelSize";
+
+ label.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMapSet );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( EXPECTED_NATURAL_SIZE, label.GetNaturalSize(), TEST_LOCATION );
+
+ END_TEST;
+}