"Default ☪ \n" //default presentation
"FamilyManWomanGirlBoy 👨‍👩‍👧‍👦\n" // emoji multi zwj sequence
"WomanScientist 👩‍🔬\n" // emoji zwj sequence
- "WomanScientistLightSkinTone👩🏻‍🔬 \n" //emoji modifier sequence: skin tone & JWZ
- "LeftRightArrowText↔︎\n" //text presentation sequence and selector
- "LeftRightArrowEmoji↔️\n" //emoji presentation sequence and selector
- "SouthKoreaFlag🇰🇷\n" //emoji flag sequence
+ "WomanScientistLightSkinTone👩🏻‍🔬 \n" // emoji modifier sequence: skin tone & JWZ
+ "LeftRightArrowText↔︎\n" // text presentation sequence and selector
+ "LeftRightArrowEmoji↔️\n" // emoji presentation sequence and selector
+ "SouthKoreaFlag🇰🇷\n" // emoji flag sequence
"JordanFlag🇯🇴\n" // emoji flag sequence
- "EnglandFlag🏴󠁧󠁢󠁥󠁮󠁧󠁿\n" //emoji tag sequence like England flag
+ "EnglandFlag🏴󠁧󠁢󠁥󠁮󠁧󠁿\n" // emoji tag sequence like England flag
"Runner 🏃‍➡️ \n"
- "VictoryHandMediumLightSkinTone:✌️🏼\n" //emoji modifier sequence: skin tone
- "RainbowFlag:🏳️‍🌈 \n" //emoji zwj sequence: Rainbow Flag
- "keycap# #️⃣ \n" // fully-qualified emoji keycap sequence
- "keycap#_text #⃣ \n" // unqualified emoji keycap sequence
- "keycap3 3️⃣ \n" // fully-qualified emoji keycap sequence
- "keycap3_text 3⃣ \n" // unqualified emoji keycap sequence
- "two adjacent glyphs ☪️️️☪️\n" //This line should be rendered as two adjacent glyphs
- "Digit 8️ 8︎ 8\n" // should be rendered according to selector
- "Surfing Medium Skin Female: 🏄🏼‍♀️"; // Person Surfing + Medium Skin Tone +? Zero Width Joiner + Female Sign
+ "VictoryHandMediumLightSkinTone:✌️🏼\n" // emoji modifier sequence: skin tone
+ "RainbowFlag:🏳️‍🌈 \n" // emoji zwj sequence: Rainbow Flag
+ "keycap# #️⃣ \n" // fully-qualified emoji keycap sequence
+ "keycap#_text #⃣ \n" // unqualified emoji keycap sequence
+ "keycap3 3️⃣ \n" // fully-qualified emoji keycap sequence
+ "keycap3_text 3⃣ \n" // unqualified emoji keycap sequence
+ "two adjacent glyphs ☪️️️☪️\n" // This line should be rendered as two adjacent glyphs
+ "Digit 8️ 8︎ 8\n" // should be rendered according to selector
+ "Surfing Medium Skin Female: 🏄🏼‍♀️\n" // Person Surfing + Medium Skin Tone +? Zero Width Joiner + Female Sign
+ "SYMBOLS_NSLCL variation selector: 🅰️🅱️🅲︎🅳︎🅴︎\n" // 1F170 ~ 1F174 with variation selector, text vs emoji
+ "SYMBOLS_NSLCL with VS15: 🅰︎🅱︎🅲︎🅳︎🅴︎\n" // 1F170 ~ 1F174 with VS15
+ "SYMBOLS_NSLCL with VS16: 🅰️🅱️🅲️🅳️🅴️\n" // 1F170 ~ 1F174 with VS16
+
+ ;
label.SetProperty(TextLabel::Property::TEXT, emojiSequences);
label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true);
const bool enabled = label.GetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL).Get<bool>();
DALI_TEST_CHECK(!enabled);
+ label.SetProperty(TextLabel::Property::MULTI_LINE, false);
+ label.SetProperty(TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 1);
+ label.SetProperty(TextLabel::Property::AUTO_SCROLL_SPEED, 9999.0f);
+ label.SetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL, true);
+
+ try
+ {
+ // Render the text.
+ application.SendNotification();
+ application.Render(1000);
+
+ application.GetScene().Remove(label);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(!label.GetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL).Get<bool>());
+
+ label.SetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL, true);
+ application.GetScene().Add(label);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(label.GetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL).Get<bool>());
+
+ label.SetProperty(TextLabel::Property::AUTO_SCROLL_STOP_MODE, (Toolkit::TextLabel::AutoScrollStopMode::Type)2); // invalid type
+ label.SetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL, false);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(label.GetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL).Get<bool>());
+ }
+ catch(...)
+ {
+ tet_result(TET_FAIL);
+ }
+
END_TEST;
}
END_TEST;
}
+int UtcDaliToolkitTextlabelTextFitStressTest(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelTextFitStressTest");
+ TextLabel label = TextLabel::New();
+ Vector2 size(460.0f, 100.0f);
+ label.SetProperty(Actor::Property::SIZE, size);
+ label.SetProperty(TextLabel::Property::TEXT, "Hello world");
+
+ // connect to the text git changed signal.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ DevelTextLabel::TextFitChangedSignal(label).Connect(&TestTextFitChangedCallback);
+ bool textFitChangedSignal = false;
+ label.ConnectSignal(testTracker, "textFitChanged", CallbackFunctor(&textFitChangedSignal));
+ gTextFitChangedCallBackCalled = false;
+
+ // check point size with veryvery big range
+ Property::Map textFitMapSet;
+ textFitMapSet["enable"] = true;
+ textFitMapSet["minSize"] = 10.f;
+ textFitMapSet["maxSize"] = 10000.f;
+ textFitMapSet["stepSize"] = -1.0f;
+ textFitMapSet["fontSizeType"] = "pointSize";
+
+ label.SetProperty(Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMapSet);
+ label.SetProperty(TextLabel::Property::POINT_SIZE, 120.f);
+
+ application.GetScene().Add(label);
+
+ application.SendNotification();
+ application.Render();
+
+ const Vector3 EXPECTED_NATURAL_SIZE(450.0f, 96.0f, 0.0f);
+ DALI_TEST_EQUALS(EXPECTED_NATURAL_SIZE, label.GetNaturalSize(), TEST_LOCATION);
+
+ DALI_TEST_CHECK(gTextFitChangedCallBackCalled);
+ DALI_TEST_CHECK(textFitChangedSignal);
+
+ END_TEST;
+}
+
int UtcDaliToolkitTextlabelMaxTextureSet(void)
{
ToolkitTestApplication application;
application.SendNotification();
application.Render();
-
END_TEST;
}
TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
+ positionsList.Clear();
+ sizeList.Clear();
+
+ startIndex = 2;
+ endIndex = 0;
+
+ positionsList = DevelTextLabel::GetTextPosition(label, startIndex, endIndex);
+ sizeList = DevelTextLabel::GetTextSize(label, startIndex, endIndex);
+
+ TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
+
+ END_TEST;
+}
+
+int utcDaliTextLabelGeometryNullPtr(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("utcDaliTextLabelGeometryNullPtr");
+
+ TextLabel label = TextLabel::New();
+ DALI_TEST_CHECK(label);
+
+ application.GetScene().Add(label);
+
+ label.SetProperty(TextLabel::Property::POINT_SIZE, 7.f);
+ label.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true);
+ label.SetProperty(TextLabel::Property::TEXT, "");
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ unsigned int expectedCount = 0;
+ unsigned int startIndex = 0;
+ unsigned int endIndex = 0;
+
+ Vector<Vector2> positionsList = DevelTextLabel::GetTextPosition(label, startIndex, endIndex);
+ Vector<Vector2> sizeList = DevelTextLabel::GetTextSize(label, startIndex, endIndex);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
+
END_TEST;
}
application.Render();
END_TEST;
+}
+
+int utcDaliTextLabelGetTextBoundingRectangle(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextLabelGeometryEllipsisMiddle");
+
+ TextLabel label = TextLabel::New();
+ DALI_TEST_CHECK(label);
+
+ application.GetScene().Add(label);
+
+ label.SetProperty(TextLabel::Property::POINT_SIZE, 7.f);
+ label.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+ label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ label.SetProperty(TextLabel::Property::TEXT, "Hello this is the Text Bounding Rectangle TC");
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ unsigned int startIndex = 0;
+ unsigned int endIndex = 15;
+
+ Rect<> textBoundingRectangle = DevelTextLabel::GetTextBoundingRectangle(label, startIndex, endIndex);
+ Rect<> expectedTextBoundingRectangle = {0, 0, 100, 25};
+
+ TestTextGeometryUtils::CheckRectGeometryResult(textBoundingRectangle, expectedTextBoundingRectangle);
+
+ END_TEST;
}
\ No newline at end of file