tet_infoline(" UtcDaliTextLabelHyphenWrapMode ");
int lineCount = 0;
+ int getLineCount = 0;
TextLabel label = TextLabel::New();
label.SetProperty(Actor::Property::SIZE, Vector2(150.0f, 300.f));
label.SetProperty(TextLabel::Property::POINT_SIZE, 12.f);
*/
DALI_TEST_EQUALS(lineCount, 2, TEST_LOCATION);
+ getLineCount = DevelTextLabel::GetLineCount(label, 150.0f);
+ DALI_TEST_EQUALS(getLineCount, 2, TEST_LOCATION);
+
label.SetProperty(TextLabel::Property::TEXT, "Hi Experimen");
label.SetProperty(TextLabel::Property::LINE_WRAP_MODE, DevelText::LineWrap::MIXED);
DALI_TEST_EQUALS(label.GetProperty<int>(TextLabel::Property::LINE_WRAP_MODE), static_cast<int>(DevelText::LineWrap::MIXED), TEST_LOCATION);
*/
DALI_TEST_EQUALS(lineCount, 3, TEST_LOCATION);
+ getLineCount = DevelTextLabel::GetLineCount(label, 150.0f);
+ DALI_TEST_EQUALS(getLineCount, 3, TEST_LOCATION);
+
END_TEST;
}
GetImpl(textLabel).RequestAsyncHeightForWidth(width);
}
+int GetLineCount(TextLabel textLabel, float width)
+{
+ return GetImpl(textLabel).GetLineCount(width);
+}
+
} // namespace DevelTextLabel
} // namespace Toolkit
*/
DALI_TOOLKIT_API void RequestAsyncHeightForWidth(TextLabel textLabel, float width);
+/**
+ * @brief Retrieves the text's number of lines for a given width.
+ * @param[in] textLabel The instance of TextLabel.
+ * @param[in] width The width of the text's area.
+ * @return The number of lines.
+ */
+DALI_TOOLKIT_API int GetLineCount(TextLabel textLabel, float width);
+
/**
* @brief Anchor clicked signal type.
*
*/
void RequestAsyncNaturalSize();
+ /**
+ * @brief Retrieves the text's number of lines for a given width.
+ * @param[in] width The width of the text's area.
+ * @return The number of lines.
+ */
+ int GetLineCount(float width);
+
/**
* @brief Requests asynchronous computation of the height of the text based on the given width.
* @param[in] width The width of text to compute.