2 * Copyright (c) 2022 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.
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/devel-api/controls/text-controls/text-spannable.h>
25 #include <dali-toolkit/devel-api/text/spannable-string.h>
26 #include <dali-toolkit/devel-api/text/spans/background-color-span.h>
27 #include <dali-toolkit/devel-api/text/spans/bold-span.h>
28 #include <dali-toolkit/devel-api/text/spans/character-spacing-span.h>
29 #include <dali-toolkit/devel-api/text/spans/font-span.h>
30 #include <dali-toolkit/devel-api/text/spans/foreground-color-span.h>
31 #include <dali-toolkit/devel-api/text/spans/italic-span.h>
32 #include <dali-toolkit/devel-api/text/spans/strikethrough-span.h>
33 #include <dali-toolkit/devel-api/text/spans/underline-span.h>
34 #include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
35 #include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
36 #include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
37 #include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
38 #include <dali-toolkit/internal/text/controller/text-controller.h>
39 #include <dali-toolkit/internal/text/font-description-run.h>
40 #include <dali-toolkit/internal/text/rendering/text-typesetter.h>
41 #include <dali-toolkit/internal/text/rendering/view-model.h>
42 #include <dali-toolkit/internal/text/text-view.h>
43 #include <dali-toolkit/public-api/text/text-enumerations.h>
44 #include <toolkit-text-utils.h>
47 using namespace Toolkit;
51 const std::string DEFAULT_FONT_DIR("/resources/fonts");
52 const float PIXEL_FORMAT_64_FACTOR = 64.f; ///< 64.f is used to convert from point size to 26.6 pixel format.
55 Text::SpannableString CreateSpannableStringForStrikethroughSpan()
57 Text::SpannableString spannableString = Text::SpannableString::New("Hello World");
58 DALI_TEST_CHECK(spannableString);
60 auto isAddedStrikethroughSpan = spannableString.AttachSpan(
61 Text::StrikethroughSpan::New(Color::GREEN, 5.0f),
62 Text::Range::New(5u, 7u));
63 DALI_TEST_CHECK(isAddedStrikethroughSpan);
65 return spannableString;
68 Text::SpannableString CreateSpannableStringForForegroundColorSpan()
70 Text::SpannableString spannableString = Text::SpannableString::New("Hello مرحبا");
71 DALI_TEST_CHECK(spannableString);
73 auto isAddedGreen = spannableString.AttachSpan(
74 Text::ForegroundColorSpan::New(Color::GREEN),
75 Text::Range::New(5u, 7u));
76 DALI_TEST_CHECK(isAddedGreen);
78 return spannableString;
81 Text::SpannableString CreateSpannableStringForFontSpan()
83 Text::SpannableString spannableString = Text::SpannableString::New("Hello World");
84 DALI_TEST_CHECK(spannableString);
86 auto isAddedFontSpan = spannableString.AttachSpan(
87 Text::FontSpan::New("TizenSans",
89 Dali::TextAbstraction::FontWeight::BOLD,
90 Dali::TextAbstraction::FontWidth::SEMI_CONDENSED,
91 Dali::TextAbstraction::FontSlant::OBLIQUE),
92 Text::Range::New(5u, 7u));
93 DALI_TEST_CHECK(isAddedFontSpan);
95 return spannableString;
98 Text::SpannableString CreateSpannableStringForUnderlineSpan()
100 Text::SpannableString spannableString = Text::SpannableString::New("Hello World");
101 DALI_TEST_CHECK(spannableString);
103 auto isAddedUnderlineSpan = spannableString.AttachSpan(
104 Text::UnderlineSpan::NewDashed(Color::GREEN, 5.0f, 2.0f, 3.0f),
105 Text::Range::New(5u, 7u));
106 DALI_TEST_CHECK(isAddedUnderlineSpan);
108 return spannableString;
111 Text::SpannableString CreateSpannableStringForCharacterSpacing()
113 Text::SpannableString spannableString = Text::SpannableString::New("Hello World");
114 DALI_TEST_CHECK(spannableString);
116 auto isCharacterSpacingSpan = spannableString.AttachSpan(
117 Text::CharacterSpacingSpan::New(5.2f),
118 Text::Range::New(5u, 7u));
119 DALI_TEST_CHECK(isCharacterSpacingSpan);
121 return spannableString;
124 Text::SpannableString CreateSpannableStringForBoldSpan()
126 Text::SpannableString spannableString = Text::SpannableString::New("Hello");
127 DALI_TEST_CHECK(spannableString);
129 auto boldspan = Dali::Toolkit::Text::BoldSpan::New();
130 auto isBoldSpan = spannableString.AttachSpan(boldspan, Dali::Toolkit::Text::Range::New(0u, 3u));
131 DALI_TEST_CHECK(isBoldSpan);
133 return spannableString;
136 Text::SpannableString CreateSpannableStringForItalicSpan()
138 Text::SpannableString spannableString = Text::SpannableString::New("Hello");
139 DALI_TEST_CHECK(spannableString);
141 auto isAddedItalic = spannableString.AttachSpan(
142 Text::ItalicSpan::New(),
143 Text::Range::New(0u, 3u));
144 DALI_TEST_CHECK(isAddedItalic);
146 return spannableString;
149 Text::SpannableString CreateSpannableStringForBackgroundColorSpan()
151 Text::SpannableString spannableString = Text::SpannableString::New("Hello مرحبا");
153 DALI_TEST_CHECK(spannableString);
155 auto isAddedGreen = spannableString.AttachSpan(
156 Text::BackgroundColorSpan::New(Color::GREEN),
157 Text::Range::New(5u, 7u));
158 DALI_TEST_CHECK(isAddedGreen);
160 return spannableString;
163 void CheckColorIndices(const Text::ColorIndex* const colorIndicesBuffer,
164 uint32_t numberOfIndices,
165 std::vector<uint32_t> indicesToCheck,
166 std::vector<uint32_t> expectedValues)
168 DALI_TEST_CHECK(colorIndicesBuffer);
170 for(uint32_t i = 0u; i < numberOfIndices; i++)
172 DALI_TEST_EQUALS(colorIndicesBuffer[indicesToCheck[i]], expectedValues[i], TEST_LOCATION);
176 int UtcDaliToolkitTextLabelSetSpannedText(void)
178 ToolkitTestApplication application;
179 tet_infoline(" UtcDaliToolkitTextLabelSetSpannedText");
181 TextLabel textLabel = TextLabel::New();
182 DALI_TEST_CHECK(textLabel);
183 application.GetScene().Add(textLabel);
185 Text::SpannableString spannableString = CreateSpannableStringForForegroundColorSpan();
187 Text::SetSpannedText(textLabel, spannableString);
189 application.SendNotification();
190 application.Render();
192 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
193 const Text::ColorIndex* const colorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetColorIndices();
195 CheckColorIndices(colorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u});
200 int UtcDaliToolkitTextEditorSetSpannedText(void)
202 ToolkitTestApplication application;
203 tet_infoline(" UtcDaliToolkitTextEditorSetSpannedText");
205 TextEditor textEditor = TextEditor::New();
206 DALI_TEST_CHECK(textEditor);
207 application.GetScene().Add(textEditor);
209 Text::SpannableString spannableString = CreateSpannableStringForForegroundColorSpan();
211 Text::SetSpannedText(textEditor, spannableString);
213 application.SendNotification();
214 application.Render();
216 Toolkit::Internal::TextEditor& labelImpl = GetImpl(textEditor);
217 const Text::ColorIndex* const colorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetColorIndices();
219 CheckColorIndices(colorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u});
224 int UtcDaliToolkitTextFieldSetSpannedText(void)
226 ToolkitTestApplication application;
227 tet_infoline(" UtcDaliToolkitTextFieldSetSpannedText");
229 TextField textField = TextField::New();
230 DALI_TEST_CHECK(textField);
231 application.GetScene().Add(textField);
233 Text::SpannableString spannableString = CreateSpannableStringForForegroundColorSpan();
235 Text::SetSpannedText(textField, spannableString);
237 application.SendNotification();
238 application.Render();
240 Toolkit::Internal::TextField& labelImpl = GetImpl(textField);
241 const Text::ColorIndex* const colorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetColorIndices();
243 CheckColorIndices(colorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u});
248 int UtcDaliToolkitTextLabelSetSpannedText_FontSpan(void)
250 ToolkitTestApplication application;
251 tet_infoline(" UtcDaliToolkitTextLabelSetSpannedText_FontSpan ");
253 // Load some fonts to get the same metrics on different platforms.
254 TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
255 fontClient.SetDpi(96u, 96u);
257 char* pathNamePtr = get_current_dir_name();
258 const std::string pathName(pathNamePtr);
261 fontClient.GetFontId(pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf");
263 TextLabel textLabel = TextLabel::New();
264 DALI_TEST_CHECK(textLabel);
265 application.GetScene().Add(textLabel);
267 Text::SpannableString spannableString = CreateSpannableStringForFontSpan();
269 Text::SetSpannedText(textLabel, spannableString);
271 application.SendNotification();
272 application.Render();
274 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
275 const Vector<Dali::Toolkit::Text::FontRun>& validFontRuns = labelImpl.GetTextController()->GetTextModel()->GetFontRuns();
277 DALI_TEST_EQUALS(validFontRuns.Count(), 3u, TEST_LOCATION);
279 DALI_TEST_EQUALS(validFontRuns[0].fontId, validFontRuns[2].fontId, TEST_LOCATION);
280 DALI_TEST_NOT_EQUALS(validFontRuns[0].fontId, validFontRuns[1].fontId, Math::MACHINE_EPSILON_100, TEST_LOCATION);
282 DALI_TEST_EQUALS(validFontRuns[1].characterRun.characterIndex, 5u, TEST_LOCATION);
283 DALI_TEST_EQUALS(validFontRuns[1].characterRun.GetEndCharacterIndex(), 7u, TEST_LOCATION);
284 DALI_TEST_EQUALS(validFontRuns[1].isItalicRequired, true, TEST_LOCATION);
285 DALI_TEST_EQUALS(validFontRuns[1].isBoldRequired, true, TEST_LOCATION);
287 TextAbstraction::FontDescription spanFontDescription;
289 float expectedPointSize = 45.0f * PIXEL_FORMAT_64_FACTOR;
290 float fontPointSize = fontClient.GetPointSize(validFontRuns[1].fontId);
291 DALI_TEST_EQUALS(fontPointSize, expectedPointSize, TEST_LOCATION);
293 const Vector<Dali::Toolkit::Text::FontDescriptionRun>& validFontDescriptionRuns = labelImpl.GetTextController()->GetTextModel()->GetFontDescriptionRuns();
294 DALI_TEST_EQUALS(validFontDescriptionRuns.Count(), 1u, TEST_LOCATION);
295 std::string familyName = validFontDescriptionRuns[0].familyName;
297 DALI_TEST_EQUALS(familyName, "TizenSans", TEST_LOCATION);
298 DALI_TEST_EQUALS(validFontDescriptionRuns[0].size, expectedPointSize, TEST_LOCATION);
299 DALI_TEST_EQUALS(validFontDescriptionRuns[0].weight, Dali::TextAbstraction::FontWeight::BOLD, TEST_LOCATION);
300 DALI_TEST_EQUALS(validFontDescriptionRuns[0].width, Dali::TextAbstraction::FontWidth::SEMI_CONDENSED, TEST_LOCATION);
301 DALI_TEST_EQUALS(validFontDescriptionRuns[0].slant, Dali::TextAbstraction::FontSlant::OBLIQUE, TEST_LOCATION);
306 int UtcDaliTextModelIsSpannedTextPlaced(void)
309 tet_infoline(" UtcDaliTextModelIsSpannedTextPlaced");
311 ToolkitTestApplication application;
313 // Create spanned-text and set it
314 Text::SpannableString spannedText = Text::SpannableString::New("Hello مرحبا");
315 DALI_TEST_CHECK(spannedText);
317 // Creates a text controller.
318 Dali::Toolkit::Text::ControllerPtr controllerTextEditor = Dali::Toolkit::Text::Controller::New();
319 const Dali::Toolkit::Text::ModelInterface* modelEditor = controllerTextEditor->GetTextModel();
321 // Tests the rendering controller has been created.
322 Dali::Toolkit::Text::TypesetterPtr typesetterEditor = Dali::Toolkit::Text::Typesetter::New(controllerTextEditor->GetTextModel());
323 DALI_TEST_CHECK(typesetterEditor);
325 // Tests the view model has been created.
326 Dali::Toolkit::Text::ViewModel* viewModelEditor = typesetterEditor->GetViewModel();
327 DALI_TEST_CHECK(viewModelEditor);
329 // Configures the text controller similarly to the text-editor.
330 Dali::Toolkit::Text::ConfigureTextEditor(controllerTextEditor);
332 DALI_TEST_EQUALS(false, modelEditor->IsSpannedTextPlaced(), TEST_LOCATION);
333 DALI_TEST_EQUALS(false, viewModelEditor->IsSpannedTextPlaced(), TEST_LOCATION);
335 controllerTextEditor->SetSpannedText(spannedText);
337 DALI_TEST_EQUALS(true, modelEditor->IsSpannedTextPlaced(), TEST_LOCATION);
338 DALI_TEST_EQUALS(true, viewModelEditor->IsSpannedTextPlaced(), TEST_LOCATION);
340 // Creates a text controller.
341 Dali::Toolkit::Text::ControllerPtr controllerTextLabel = Dali::Toolkit::Text::Controller::New();
342 const Dali::Toolkit::Text::ModelInterface* modelLabel = controllerTextLabel->GetTextModel();
344 // Tests the rendering controller has been created.
345 Dali::Toolkit::Text::TypesetterPtr typesetterLabel = Dali::Toolkit::Text::Typesetter::New(controllerTextLabel->GetTextModel());
346 DALI_TEST_CHECK(typesetterLabel);
348 // Tests the view model has been created.
349 Dali::Toolkit::Text::ViewModel* viewModelLabel = typesetterLabel->GetViewModel();
350 DALI_TEST_CHECK(viewModelLabel);
352 // Configures the text controller similarly to the text-label.
353 Dali::Toolkit::Text::ConfigureTextLabel(controllerTextLabel);
355 DALI_TEST_EQUALS(false, modelLabel->IsSpannedTextPlaced(), TEST_LOCATION);
356 DALI_TEST_EQUALS(false, viewModelLabel->IsSpannedTextPlaced(), TEST_LOCATION);
358 controllerTextLabel->SetSpannedText(spannedText);
360 DALI_TEST_EQUALS(true, modelLabel->IsSpannedTextPlaced(), TEST_LOCATION);
361 DALI_TEST_EQUALS(true, viewModelLabel->IsSpannedTextPlaced(), TEST_LOCATION);
363 // Creates a text controller.
364 Dali::Toolkit::Text::ControllerPtr controllerTextField = Dali::Toolkit::Text::Controller::New();
365 const Dali::Toolkit::Text::ModelInterface* modelField = controllerTextField->GetTextModel();
367 // Tests the rendering controller has been created.
368 Dali::Toolkit::Text::TypesetterPtr typesetterField = Dali::Toolkit::Text::Typesetter::New(controllerTextField->GetTextModel());
369 DALI_TEST_CHECK(typesetterField);
371 // Tests the view model has been created.
372 Dali::Toolkit::Text::ViewModel* viewModelField = typesetterField->GetViewModel();
373 DALI_TEST_CHECK(viewModelField);
375 // Configures the text controller similarly to the text-field.
376 Dali::Toolkit::Text::ConfigureTextField(controllerTextField);
378 DALI_TEST_EQUALS(false, modelField->IsSpannedTextPlaced(), TEST_LOCATION);
379 DALI_TEST_EQUALS(false, viewModelField->IsSpannedTextPlaced(), TEST_LOCATION);
381 controllerTextField->SetSpannedText(spannedText);
383 DALI_TEST_EQUALS(true, modelField->IsSpannedTextPlaced(), TEST_LOCATION);
384 DALI_TEST_EQUALS(true, viewModelField->IsSpannedTextPlaced(), TEST_LOCATION);
386 tet_result(TET_PASS);
391 int UtcDaliToolkitTextLabelSetSpannedText_UnderlineSpan(void)
393 ToolkitTestApplication application;
394 tet_infoline(" UtcDaliToolkitTextLabelSetSpannedText_UnderlineSpan ");
396 Dali::Toolkit::Text::UnderlineStyleProperties expectedProperties = {
397 Text::Underline::DASHED,
408 TextLabel textLabel = TextLabel::New();
409 DALI_TEST_CHECK(textLabel);
410 application.GetScene().Add(textLabel);
412 Text::SpannableString spannableString = CreateSpannableStringForUnderlineSpan();
414 Text::SetSpannedText(textLabel, spannableString);
416 application.SendNotification();
417 application.Render();
419 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
420 const Text::Length numberOfUnderlineRuns = labelImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns();
422 DALI_TEST_EQUALS(numberOfUnderlineRuns, 1u, TEST_LOCATION);
424 Vector<Dali::Toolkit::Text::UnderlinedGlyphRun> underlineRuns;
426 underlineRuns.Resize(numberOfUnderlineRuns);
428 labelImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns);
430 DALI_TEST_EQUALS(underlineRuns[0].glyphRun.glyphIndex, 5u, TEST_LOCATION);
431 DALI_TEST_EQUALS(underlineRuns[0].glyphRun.numberOfGlyphs, 3u, TEST_LOCATION);
432 DALI_TEST_CHECK(underlineRuns[0].properties == expectedProperties);
437 int UtcDaliToolkitTextLabelSetSpannedText_CharacterSpacingSpan(void)
439 ToolkitTestApplication application;
440 tet_infoline("UtcDaliToolkitTextLabelSetSpannedText_CharacterSpacingSpan");
442 TextLabel textLabel = TextLabel::New();
443 DALI_TEST_CHECK(textLabel);
444 application.GetScene().Add(textLabel);
446 Text::SpannableString spannableString = CreateSpannableStringForCharacterSpacing();
447 Text::SetSpannedText(textLabel, spannableString);
449 application.SendNotification();
450 application.Render();
452 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
453 const Vector<Dali::Toolkit::Text::CharacterSpacingGlyphRun> characterSpacing = labelImpl.GetTextController()->GetTextModel()->GetCharacterSpacingGlyphRuns();
454 DALI_TEST_EQUALS(1, characterSpacing.Count(), TEST_LOCATION);
458 int UtcDaliToolkitTextLabelSetSpannedText_BoldSpan(void)
460 ToolkitTestApplication application;
462 tet_infoline("UtcDaliToolkitTextLabelSetSpannedText_BoldSpan");
464 TextLabel textLabel = TextLabel::New();
466 DALI_TEST_CHECK(textLabel);
468 application.GetScene().Add(textLabel);
470 Text::SpannableString spannableString = CreateSpannableStringForBoldSpan();
471 Text::SetSpannedText(textLabel, spannableString);
473 application.SendNotification();
474 application.Render();
476 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
478 const Vector<Text::FontRun>& validFonts = labelImpl.GetTextController()->GetTextModel()->GetFontRuns();
480 DALI_TEST_EQUALS(validFonts.Count(), 2, TEST_LOCATION);
481 DALI_TEST_EQUALS(validFonts[0].characterRun.characterIndex, 0, TEST_LOCATION);
482 DALI_TEST_EQUALS(validFonts[0].characterRun.GetEndCharacterIndex(), 3, TEST_LOCATION);
483 DALI_TEST_EQUALS(validFonts[0].isBoldRequired, true, TEST_LOCATION);
487 int UtcDaliToolkitTextLabelSetSpannedText_ItalicSpan(void)
489 ToolkitTestApplication application;
490 tet_infoline("UtcDaliToolkitTextLabelSetSpannedText_ItalicSpan");
492 TextLabel textLabel = TextLabel::New();
493 DALI_TEST_CHECK(textLabel);
495 application.GetScene().Add(textLabel);
497 Text::SpannableString spannableString = CreateSpannableStringForItalicSpan();
499 Text::SetSpannedText(textLabel, spannableString);
500 application.SendNotification();
501 application.Render();
503 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
504 const Vector<Text::FontRun>& validFontsItalic = labelImpl.GetTextController()->GetTextModel()->GetFontRuns();
506 DALI_TEST_EQUALS(validFontsItalic.Count(), 2, TEST_LOCATION);
507 DALI_TEST_EQUALS(validFontsItalic[0].characterRun.characterIndex, 0, TEST_LOCATION);
508 DALI_TEST_EQUALS(validFontsItalic[0].characterRun.GetEndCharacterIndex(), 3, TEST_LOCATION);
509 DALI_TEST_EQUALS(validFontsItalic[0].isItalicRequired, true, TEST_LOCATION);
513 int UtcDaliToolkitTextLabelSetSpannedText_BackgroundColorSpan(void)
515 ToolkitTestApplication application;
516 tet_infoline("UtcDaliToolkitTextLabelSetSpannedText_BackgroundColorSpan");
518 TextLabel textLabel = TextLabel::New();
519 DALI_TEST_CHECK(textLabel);
521 application.GetScene().Add(textLabel);
523 Text::SpannableString spannableString = CreateSpannableStringForBackgroundColorSpan();
524 Text::SetSpannedText(textLabel, spannableString);
526 application.SendNotification();
527 application.Render();
529 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
530 const Text::ColorIndex* const backgroundColorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices();
532 CheckColorIndices(backgroundColorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u});
537 int UtcDaliToolkitTextLabelSetSpannedText_StrikethroughSpan(void)
539 ToolkitTestApplication application;
541 tet_infoline(" UtcDaliToolkitTextLabelSetSpannedText_StrikethroughSpan ");
543 Dali::Toolkit::Text::StrikethroughStyleProperties expectedProperties = {
549 TextLabel textLabel = TextLabel::New();
551 DALI_TEST_CHECK(textLabel);
553 application.GetScene().Add(textLabel);
555 Text::SpannableString spannableString = CreateSpannableStringForStrikethroughSpan();
556 Text::SetSpannedText(textLabel, spannableString);
558 application.SendNotification();
559 application.Render();
561 Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
563 const Text::Length numberOfStrikethroughRuns = labelImpl.GetTextController()->GetTextModel()->GetNumberOfStrikethroughRuns();
565 DALI_TEST_EQUALS(numberOfStrikethroughRuns, 1u, TEST_LOCATION);
567 Vector<Dali::Toolkit::Text::StrikethroughGlyphRun> strikethroughRuns;
568 strikethroughRuns.Resize(numberOfStrikethroughRuns);
570 labelImpl.GetTextController()->GetTextModel()->GetStrikethroughRuns(strikethroughRuns.Begin(), 0u, numberOfStrikethroughRuns);
572 DALI_TEST_EQUALS(strikethroughRuns[0].glyphRun.glyphIndex, 5u, TEST_LOCATION);
573 DALI_TEST_EQUALS(strikethroughRuns[0].glyphRun.numberOfGlyphs, 3u, TEST_LOCATION);
574 DALI_TEST_CHECK(strikethroughRuns[0].properties == expectedProperties);