Text Fit 58/206458/19
authorJoogab Yun <joogab.yun@samsung.com>
Mon, 20 May 2019 05:59:13 +0000 (14:59 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Mon, 10 Jun 2019 08:20:55 +0000 (08:20 +0000)
commita267f3da043b1b792ffc64d1848542aa761e44c0
tree35f5cbcf92ce903db2a8cc368e0d5d0c46913158
parentd222ce80a14a832bf738fb7c8036e7bd4bc6dd29
Text Fit
- Adjust the text point size to match the size of the TextLabel.

sample) If TEXT_FIT is set to true,
        the size of the text will increase to match the size of SetSize()

    Property::Map backgroundMap;
    backgroundMap["color"] = Color::RED;
    backgroundMap["enable"] = true;

    Property::Map textFitMap;
    textFitMap["enable"] = true;
    textFitMap["minSize"] = 10.f;
    textFitMap["maxSize"] = 100.f;
    textFitMap["stepSize"] = 1.f;
    textFitMap["fontSizeType"] = "pointSize";

    TextLabel textFit = TextLabel::New(  "This is a sample text " );
    textFit.SetSize( 450, 100 );
    textFit.SetParentOrigin(ParentOrigin::TOP_LEFT);
    textFit.SetAnchorPoint(AnchorPoint::TOP_LEFT);
    textFit.SetPosition( 100.f, 100.f);
    textFit.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMap );
    textFit.SetProperty( Toolkit::DevelTextLabel::Property::BACKGROUND, backgroundMap );
    stage.Add( textFit );

Change-Id: I50fea94547bc8147dd211f597520b27a35c8eb85
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/devel-api/controls/text-controls/text-label-devel.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h