2 * Copyright (c) 2021 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 <toolkit-text-utils.h>
25 #include <dali-toolkit/internal/text/font-description-run.h>
26 #include <dali-toolkit/internal/text/rendering/text-typesetter.h>
27 #include <dali-toolkit/internal/text/rendering/view-model.h>
28 #include <dali-toolkit/internal/text/text-controller.h>
29 #include <dali-toolkit/internal/text/text-view.h>
33 using namespace Toolkit;
40 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
44 std::string description;
47 DevelText::LineWrap::Mode lineWrapMode;
48 DevelText::EllipsisPosition::Type ellipsisPosition;
51 unsigned int numberOfLines;
52 unsigned int numberOfGlyphs;
57 bool ElideTestViewModel( const ElideData& data )
59 std::cout << " testing : " << data.description << std::endl;
62 TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
63 fontClient.SetDpi( 93u, 93u );
65 char* pathNamePtr = get_current_dir_name();
66 const std::string pathName( pathNamePtr );
69 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
70 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
71 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
73 // Creates a text controller.
74 ControllerPtr controller = Controller::New();
76 // Tests the rendering controller has been created.
77 TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() );
78 DALI_TEST_CHECK(typesetter);
80 // Tests the view model has been created.
81 ViewModel* model = typesetter->GetViewModel();
82 DALI_TEST_CHECK(model);
84 // Configures the text controller similarly to the text-label.
85 ConfigureTextLabel( controller );
87 // Sets a text and relais-out.
88 controller->SetMarkupProcessorEnabled( data.isMarkup );
90 controller->SetMultiLineEnabled( data.isMultiLines );
91 controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
92 controller->SetEllipsisPosition( data.ellipsisPosition );
94 controller->SetText( data.text );
95 controller->Relayout( data.size );
100 if( data.numberOfLines != model->GetNumberOfLines() )
102 std::cout << " different number of lines : " << model->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
106 Length numberOfGlyphs = model->GetNumberOfGlyphs();
108 if( data.numberOfGlyphs != numberOfGlyphs )
110 std::cout << " different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
114 const Vector2* const layoutBuffer = model->GetLayout();
115 const Length numberOfLines = model->GetNumberOfLines();
116 const GlyphIndex startIndexOfGlyphs = model->GetStartIndexOfElidedGlyphs();
117 const GlyphIndex endIndexOfGlyphs = model->GetEndIndexOfElidedGlyphs();
118 const GlyphIndex firstMiddleIndexOfGlyphs = model->GetFirstMiddleIndexOfElidedGlyphs();
121 if( numberOfLines != 0u )
123 Length elidedLineIndex = 0u;
124 for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
126 const LineRun& tempLine = *( model->GetLines() + elidedLineIndex);
127 if(tempLine.ellipsis)
129 elidedLineIndex = lineIndex;
133 const LineRun& elidedLine = *( model->GetLines() + elidedLineIndex);
134 Length numberOfLineGlyphs = 0u;
135 Length numberOfLineGlyphsSecondHalf = 0u;
137 switch(data.ellipsisPosition)
139 case DevelText::EllipsisPosition::START:
141 numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
144 case DevelText::EllipsisPosition::MIDDLE:
146 numberOfLineGlyphs = firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u ;
149 case DevelText::EllipsisPosition::END:
152 numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
157 unsigned int index = 0u;
158 for( ; index < numberOfLineGlyphs; ++index )
160 if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
162 std::cout << " different layout :";
163 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
165 std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
167 std::cout << std::endl;
168 std::cout << " expected :";
169 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
171 std::cout << " " << *( data.positions + i );
173 std::cout << std::endl;
179 for( ; index < numberOfLineGlyphsSecondHalf; ++index )
181 if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
183 std::cout << " different layout :";
184 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
186 std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
188 std::cout << std::endl;
189 std::cout << " expected :";
190 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
192 std::cout << " " << *( data.positions + i );
194 std::cout << std::endl;
204 bool ElideTestTextView( const ElideData& data )
206 std::cout << " testing : " << data.description << std::endl;
209 TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
210 fontClient.SetDpi( 93u, 93u );
212 char* pathNamePtr = get_current_dir_name();
213 const std::string pathName( pathNamePtr );
216 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
217 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
218 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
220 // Creates a text controller.
221 ControllerPtr controller = Controller::New();
223 if(data.isMultiLines)
225 // Configures the text controller similarly to the text-editor.
226 ConfigureTextEditor( controller );
227 controller->SetVerticalScrollEnabled( false );
231 // Configures the text controller similarly to the text-field.
232 ConfigureTextField( controller );
235 controller->SetDefaultFontFamily("TizenSansRegular");
236 controller->SetDefaultFontSize(12.0f, Text::Controller::POINT_SIZE);
238 controller->SetMultiLineEnabled( data.isMultiLines );
239 controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
241 // Sets a text and relais-out.
242 controller->SetMarkupProcessorEnabled( data.isMarkup );
244 controller->SetTextElideEnabled( true );
245 controller->SetEllipsisPosition( data.ellipsisPosition );
247 controller->SetText( data.text );
248 controller->Relayout( data.size );
250 // Get view to elide the glyphs.
251 Text::ViewInterface& view = controller->GetView();
253 Length numberOfGlyphs = view.GetNumberOfGlyphs();
255 if(numberOfGlyphs == 0u)
257 return data.numberOfGlyphs == 0u;
260 Vector<GlyphInfo> glyphs;
261 glyphs.Resize(numberOfGlyphs);
263 Vector<Vector2> positions;
264 positions.Resize(numberOfGlyphs);
266 float alignmentOffset = 0u;
267 numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
273 glyphs.Resize(numberOfGlyphs);
274 positions.Resize(numberOfGlyphs);
277 if( data.numberOfGlyphs != numberOfGlyphs )
279 std::cout << " different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
283 // Tests the text model has been created.
284 const ModelInterface* textModel = controller->GetTextModel();
285 DALI_TEST_CHECK(textModel);
287 if( data.numberOfLines != textModel->GetNumberOfLines() )
289 std::cout << " different number of lines : " << textModel->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
293 const Length numberOfLines = textModel->GetNumberOfLines();
294 const GlyphIndex startIndexOfGlyphs = textModel->GetStartIndexOfElidedGlyphs();
295 const GlyphIndex endIndexOfGlyphs = textModel->GetEndIndexOfElidedGlyphs();
296 const GlyphIndex firstMiddleIndexOfGlyphs = textModel->GetFirstMiddleIndexOfElidedGlyphs();
297 const GlyphIndex secondMiddleIndexOfGlyphs = textModel->GetSecondMiddleIndexOfElidedGlyphs();
299 if( numberOfLines != 0u )
301 Length elidedLineIndex = 0u;
302 for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
304 const LineRun& tempLine = *( textModel->GetLines() + lineIndex);
305 if(tempLine.ellipsis)
307 elidedLineIndex = lineIndex;
311 const LineRun& elidedLine = *( textModel->GetLines() + elidedLineIndex);
313 Length numberOfLineGlyphs = 0u;
314 Length numberOfLineGlyphsSecondHalf = 0u;
316 switch(data.ellipsisPosition)
318 case DevelText::EllipsisPosition::START:
320 numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
323 case DevelText::EllipsisPosition::MIDDLE:
325 numberOfLineGlyphs = firstMiddleIndexOfGlyphs == elidedLine.glyphRun.glyphIndex ? 0u : (firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u);
327 if(elidedLine.isSplitToTwoHalves)
329 numberOfLineGlyphsSecondHalf = (elidedLine.glyphRunSecondHalf.glyphIndex + elidedLine.glyphRunSecondHalf.numberOfGlyphs) - secondMiddleIndexOfGlyphs ;
334 case DevelText::EllipsisPosition::END:
337 numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
343 unsigned int index = 0u;
344 for( ; index < numberOfLineGlyphs; ++index )
347 if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
349 std::cout << " different layout :";
350 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
352 std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
354 std::cout << std::endl;
355 std::cout << " expected :";
356 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
358 std::cout << " " << *( data.positions + i );
360 std::cout << std::endl;
365 for( ; index < numberOfLineGlyphsSecondHalf; ++index )
367 if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
369 std::cout << " different layout :";
370 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
372 std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
374 std::cout << std::endl;
375 std::cout << " expected :";
376 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
378 std::cout << " " << *( data.positions + i );
380 std::cout << std::endl;
391 int UtcDaliTextLabelElideTextLocation(void)
393 tet_infoline(" UtcDaliTextLabelElideTextLocation ");
395 Size textSize00( 100.f, 100.f );
397 Size textSize01( 120.0f, 50.0f );
398 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
400 Size textSize02( 120.0f, 50.0f );
401 float positions02[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 49.0f, 59.0f, 69.0f, 79.0f, 90.0f };
403 Size textSize03( 120.0f, 60.0f );
404 float positions03[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 63.0f, 73.0f, 82.0f, 0.0f, 14.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 88.0f };
406 Size textSize04( 120.0f, 60.0f );
407 float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f, 103.0f, 109.0f, 0.0f, 14.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f, 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
409 Size textSize05( 110.0f, 60.0f );
410 float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 0.0f, 8.0f, 19.0f, 25.0f, 30.0f, 44.0f, 54.0f, 63.0f, 68.0f, 82.0f, 93.0f, 0.0f, 8.0f, 19.0f, 33.0f, 42.0f, 48.0f, 59.0f, 69.0f, 74.0f, 78.0f };
412 Size textSize06( 110.0f, 60.0f );
413 float positions06[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 63.0f, 73.0f, 82.0f, 0.0f, 14.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 77.0f };
415 Size textSize07( 120.0f, 50.0f );
416 float positions07[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
418 Size textSize08( 120.0f, 50.0f );
419 float positions08[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
421 Size textSize09( 120.0f, 60.0f );
422 float positions09[] = { 8.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 87.0f, 97.0f, 102.0f, 105.0f, 115.0f };
424 Size textSize10( 120.0f, 60.0f );
425 float positions10[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
427 Size textSize11( 100.0f, 60.0f );
428 float positions11[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
430 Size textSize12( 100.0f, 60.0f );
431 float positions12[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
433 Size textSize13( 120.0f, 60.0f );
434 float positions13[] = { 118.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 46.0f, 37.0f, 31.0f, 22.0f, 7.0f };
436 Size textSize14( 120.0f, 60.0f );
437 float positions14[] = { 115.0f, 108.0f, 94.0f, 86.0f, 77.0f, 71.0f, 61.0f, 56.0f, 51.0f, 43.0f, 34.0f, 30.0f, 112.0f, 104.0f, 94.0f, 89.0f, 87.0f, 81.0f, 77.0f, 67.0f, 59.0f, 54.0f, 45.0f, 38.0f, 34.0f, 30.0f, 142.0f, 131.0f, 126.0f, 121.0f, 119.0f, 109.0f, 105.0f, 91.0f, 83.0f, 74.0f, 72.0f, 66.0f, 60.0f, 55.0f, 46.0f, 32.0f };
439 Size textSize15( 110.0f, 60.0f );
440 float positions15[] = { 108.0f, 101.0f, 87.0f, 79.0f, 70.0f, 64.0f, 54.0f, 49.0f, 44.0f, 36.0f, 27.0f, 21.0f, 12.0f, 4.0f, 96.0f, 91.0f, 89.0f, 83.0f, 79.0f, 69.0f, 61.0f, 56.0f, 47.0f, 40.0f, 36.0f, 30.0f, 27.0f, 16.0f, 11.0f, 6.0f, 4.0f, 102.0f, 98.0f, 84.0f, 75.0f, 66.0f, 64.0f, 58.0f, 53.0f, 47.0f, 38.0f, 25.0f, 22.0f, 5.0f };
442 Size textSize16( 110.0f, 60.0f );
443 float positions16[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 35.0f, 28.0f, 24.0f, 20.0f, 116.0f, 104.0f, 99.0f, 95.0f, 92.0f, 83.0f, 79.0f, 65.0f, 56.0f, 48.0f, 45.0f, 39.0f, 24.0f };
445 Size textSize17( 110.0f, 60.0f );
446 float positions17[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 35.0f, 28.0f, 24.0f, 20.0f, 116.0f, 104.0f, 99.0f, 95.0f, 92.0f, 83.0f, 79.0f, 65.0f, 56.0f, 48.0f, 45.0f, 39.0f, 24.0f };
448 Size textSize18( 120.0f, 60.0f );
449 float positions18[] = { 89.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 28.0f, 25.0f, 14.0f, 7.0f, 0.0f };
451 Size textSize19( 120.0f, 60.0f );
452 float positions19[] = { 103.0f, 91.0f, 86.0f, 84.0f, 78.0f, 74.0f, 64.0f, 56.0f, 51.0f, 42.0f, 35.0f, 31.0f, 27.0f };
454 Size textSize20( 110.0f, 60.0f );
455 float positions20[] = { 89.0f, 82.0f, 78.0f, 68.0f, 60.0f, 55.0f, 46.0f, 39.0f, 35.0f, 29.0f, 26.0f, 15.0f, 10.0f, 5.0f, 3.0f };
457 Size textSize21( 110.0f, 60.0f );
458 float positions21[] = { 93.0f, 81.0f, 76.0f, 74.0f, 68.0f, 64.0f, 54.0f, 46.0f, 41.0f, 32.0f, 25.0f, 21.0f, 17.0f };
460 Size textSize22( 110.0f, 60.0f );
461 float positions22[] = { 93.0f, 81.0f, 76.0f, 74.0f, 68.0f, 64.0f, 54.0f, 46.0f, 41.0f, 32.0f, 25.0f, 21.0f, 17.0f };
463 Size textSize23( 120.0f, 50.0f );
464 float positions23[] = { 0.0f, 11.0f, 20.0f, 32.0f, 44.0f };
466 Size textSize24( 120.0f, 50.0f );
467 float positions24[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
469 Size textSize25( 120.0f, 60.0f );
470 float positions25[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 64.0f };
472 Size textSize26( 120.0f, 60.0f );
473 float positions26[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f, 103.0f, 109.0f, 0.0f, 14.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 86.0f };
475 Size textSize27( 110.0f, 60.0f );
476 float positions27[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 0.0f, 8.0f, 19.0f, 25.0f, 30.0f, 44.0f, 54.0f, 63.0f, 69.0f };
478 Size textSize28( 110.0f, 60.0f );
479 float positions28[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 64.0f };
481 Size textSize29( 120.0f, 60.0f );
482 float positions29[] = { 115.0f, 108.0f, 94.0f, 86.0f, 78.0f, 72.0f, 61.0f };
484 Size textSize30( 120.0f, 60.0f );
485 float positions30[] = { 115.0f, 108.0f, 94.0f, 86.0f, 77.0f, 71.0f, 61.0f, 56.0f, 51.0f, 43.0f, 34.0f, 30.0f, 112.0f, 104.0f, 94.0f, 89.0f, 87.0f, 81.0f, 77.0f, 67.0f, 59.0f, 54.0f, 34.0f };
487 Size textSize31( 110.0f, 60.0f );
488 float positions31[] = { 108.0f, 101.0f, 87.0f, 79.0f, 70.0f, 64.0f, 54.0f, 49.0f, 44.0f, 36.0f, 27.0f, 21.0f, 12.0f, 4.0f, 96.0f, 91.0f, 89.0f, 83.0f, 79.0f, 69.0f, 61.0f, 56.0f, 47.0f, 40.0f, 36.0f, 30.0f, 27.0f, 11.0f };
490 Size textSize32( 110.0f, 60.0f );
491 float positions32[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 24.0f };
493 Size textSize33( 110.0f, 60.0f );
494 float positions33[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 24.0f };
496 Size textSize34( 120.0f, 30.0f );
497 float positions34[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
499 Size textSize35( 120.0f, 30.0f );
500 float positions35[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
502 Size textSize36( 120.0f, 30.0f );
503 float positions36[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
505 struct ElideData data[] =
511 DevelText::LineWrap::WORD,
512 DevelText::EllipsisPosition::END,
524 DevelText::LineWrap::WORD,
525 DevelText::EllipsisPosition::START,
537 DevelText::LineWrap::WORD,
538 DevelText::EllipsisPosition::MIDDLE,
548 "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
549 "A0123456789 B0123456789 C0123456789 D0123456789 ",
551 DevelText::LineWrap::WORD,
552 DevelText::EllipsisPosition::END,
561 "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
562 "A0123456789 B0123456789 C0123456789 D0123456789 ",
564 DevelText::LineWrap::WORD,
565 DevelText::EllipsisPosition::END,
574 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
575 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
577 DevelText::LineWrap::WORD,
578 DevelText::EllipsisPosition::END,
587 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
588 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
590 DevelText::LineWrap::CHARACTER,
591 DevelText::EllipsisPosition::END,
600 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
601 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
603 DevelText::LineWrap::HYPHENATION,
604 DevelText::EllipsisPosition::END,
613 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
614 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
616 DevelText::LineWrap::MIXED,
617 DevelText::EllipsisPosition::END,
627 "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
628 "A0123456789 B0123456789 C0123456789 D0123456789 ",
630 DevelText::LineWrap::WORD,
631 DevelText::EllipsisPosition::START,
640 "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
641 "A0123456789 B0123456789 C0123456789 D0123456789 ",
643 DevelText::LineWrap::WORD,
644 DevelText::EllipsisPosition::START,
653 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
654 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
656 DevelText::LineWrap::WORD,
657 DevelText::EllipsisPosition::START,
666 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
667 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
669 DevelText::LineWrap::CHARACTER,
670 DevelText::EllipsisPosition::START,
679 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
680 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
682 DevelText::LineWrap::HYPHENATION,
683 DevelText::EllipsisPosition::START,
692 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
693 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
695 DevelText::LineWrap::MIXED,
696 DevelText::EllipsisPosition::START,
706 "EllipsisPosition: TextLabel: SingleLine RTL END",
707 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
709 DevelText::LineWrap::WORD,
710 DevelText::EllipsisPosition::END,
719 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
720 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
722 DevelText::LineWrap::WORD,
723 DevelText::EllipsisPosition::END,
732 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
733 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
735 DevelText::LineWrap::CHARACTER,
736 DevelText::EllipsisPosition::END,
745 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
746 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
748 DevelText::LineWrap::HYPHENATION,
749 DevelText::EllipsisPosition::END,
758 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
759 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
761 DevelText::LineWrap::MIXED,
762 DevelText::EllipsisPosition::END,
772 "EllipsisPosition: TextLabel: SingleLine RTL START",
773 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
775 DevelText::LineWrap::WORD,
776 DevelText::EllipsisPosition::START,
785 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
786 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
788 DevelText::LineWrap::WORD,
789 DevelText::EllipsisPosition::START,
798 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
799 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
801 DevelText::LineWrap::CHARACTER,
802 DevelText::EllipsisPosition::START,
811 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
812 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
814 DevelText::LineWrap::HYPHENATION,
815 DevelText::EllipsisPosition::START,
824 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
825 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
827 DevelText::LineWrap::MIXED,
828 DevelText::EllipsisPosition::START,
838 "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
839 "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
841 DevelText::LineWrap::WORD,
842 DevelText::EllipsisPosition::MIDDLE,
851 "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
852 "A0123456789 B0123456789 C0123456789 D0123456789 ",
854 DevelText::LineWrap::WORD,
855 DevelText::EllipsisPosition::MIDDLE,
864 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
865 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
867 DevelText::LineWrap::WORD,
868 DevelText::EllipsisPosition::MIDDLE,
877 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
878 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
880 DevelText::LineWrap::CHARACTER,
881 DevelText::EllipsisPosition::MIDDLE,
890 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
891 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
893 DevelText::LineWrap::HYPHENATION,
894 DevelText::EllipsisPosition::MIDDLE,
903 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
904 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
906 DevelText::LineWrap::MIXED,
907 DevelText::EllipsisPosition::MIDDLE,
917 "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
918 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
920 DevelText::LineWrap::WORD,
921 DevelText::EllipsisPosition::MIDDLE,
930 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
931 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
933 DevelText::LineWrap::WORD,
934 DevelText::EllipsisPosition::MIDDLE,
943 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
944 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
946 DevelText::LineWrap::CHARACTER,
947 DevelText::EllipsisPosition::MIDDLE,
956 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
957 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
959 DevelText::LineWrap::HYPHENATION,
960 DevelText::EllipsisPosition::MIDDLE,
969 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
970 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
972 DevelText::LineWrap::MIXED,
973 DevelText::EllipsisPosition::MIDDLE,
982 "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
983 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
985 DevelText::LineWrap::WORD,
986 DevelText::EllipsisPosition::END,
995 "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
996 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
998 DevelText::LineWrap::WORD,
999 DevelText::EllipsisPosition::START,
1008 "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1009 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1011 DevelText::LineWrap::WORD,
1012 DevelText::EllipsisPosition::MIDDLE,
1021 const unsigned int numberOfTests = 39u;
1023 for( unsigned int index = 0u; index < numberOfTests; ++index )
1025 ToolkitTestApplication application;
1026 if( !ElideTestViewModel( data[index] ) )
1028 tet_result(TET_FAIL);
1032 tet_result(TET_PASS);
1037 int UtcDaliTextFieldlElideTextLocation(void)
1039 tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
1041 Size textSize00( 100.f, 100.f );
1043 Size textSize01( 120.0f, 50.0f );
1044 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1046 Size textSize02( 120.0f, 50.0f );
1047 float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
1049 Size textSize03( 120.0f, 50.0f );
1050 float positions03[] = { 117.0f, 111.0f, 97.0f, 88.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 31.0f, 22.0f, 7.0f };
1052 Size textSize04( 120.0f, 50.0f );
1053 float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1055 Size textSize05( 120.0f, 50.0f );
1056 float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1058 Size textSize06( 120.0f, 50.0f );
1059 float positions06[] = { 90.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 29.0f, 26.0f, 15.0f, 7.0f, 0.0f };
1061 Size textSize07( 120.0f, 50.0f );
1062 float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f };
1064 Size textSize08( 120.0f, 50.0f );
1065 float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1067 Size textSize09( 120.0f, 50.0f );
1068 float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f };
1070 Size textSize10( 120.0f, 50.0f );
1071 float positions10[] = { 121.0f, 116.0f, 111.0f, 106.0f, 101.0f, 96.0f, 92.0f, 87.0f, 83.0f, 77.0f, 63.0f, 55.0f, 46.0f, 40.0f, 30.0f, 16.0f };
1073 Size textSize11( 120.0f, 50.0f );
1074 float positions11[] = { 93.0f, 77.0f, 74.0f, 63.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 24.0f, 19.0f, 14.0f, 9.0f, 5.0f };
1076 Size textSize12( 120.0f, 50.0f );
1077 float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f };
1079 struct ElideData data[] =
1085 DevelText::LineWrap::WORD,
1086 DevelText::EllipsisPosition::END,
1098 DevelText::LineWrap::WORD,
1099 DevelText::EllipsisPosition::START,
1111 DevelText::LineWrap::WORD,
1112 DevelText::EllipsisPosition::MIDDLE,
1121 "EllipsisPosition: TextField: Basic case SingleLine LTR END",
1122 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1124 DevelText::LineWrap::WORD,
1125 DevelText::EllipsisPosition::END,
1134 "EllipsisPosition: TextField: SingleLine LTR END",
1135 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1137 DevelText::LineWrap::WORD,
1138 DevelText::EllipsisPosition::END,
1147 "EllipsisPosition: TextField: SingleLine RTL END",
1148 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1150 DevelText::LineWrap::WORD,
1151 DevelText::EllipsisPosition::END,
1160 "EllipsisPosition: TextField: Basic case SingleLine LTR START",
1161 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1163 DevelText::LineWrap::WORD,
1164 DevelText::EllipsisPosition::START,
1173 "EllipsisPosition: TextField: SingleLine LTR START",
1174 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1176 DevelText::LineWrap::WORD,
1177 DevelText::EllipsisPosition::START,
1186 "EllipsisPosition: TextField: SingleLine RTL START",
1187 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1189 DevelText::LineWrap::WORD,
1190 DevelText::EllipsisPosition::START,
1199 "EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
1200 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1202 DevelText::LineWrap::WORD,
1203 DevelText::EllipsisPosition::MIDDLE,
1212 "EllipsisPosition: TextField: SingleLine LTR MIDDLE",
1213 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
1215 DevelText::LineWrap::WORD,
1216 DevelText::EllipsisPosition::MIDDLE,
1225 "EllipsisPosition: TextField: SingleLine RTL MIDDLE",
1226 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1228 DevelText::LineWrap::WORD,
1229 DevelText::EllipsisPosition::MIDDLE,
1238 "EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
1239 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1241 DevelText::LineWrap::WORD,
1242 DevelText::EllipsisPosition::END,
1251 "EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
1252 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1254 DevelText::LineWrap::WORD,
1255 DevelText::EllipsisPosition::START,
1264 "EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
1265 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1267 DevelText::LineWrap::WORD,
1268 DevelText::EllipsisPosition::MIDDLE,
1278 const unsigned int numberOfTests = 15u;
1280 for( unsigned int index = 0u; index < numberOfTests; ++index )
1282 ToolkitTestApplication application;
1283 if( !ElideTestTextView( data[index] ) )
1285 tet_result(TET_FAIL);
1288 tet_result(TET_PASS);
1294 int UtcDaliTextEditorElideTextLocation(void)
1296 tet_infoline(" UtcDaliTextEditorElideTextLocation ");
1298 Size textSize00( 100.f, 100.f );
1300 Size textSize01( 120.0f, 50.0f );
1301 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f };
1303 Size textSize02( 120.0f, 60.0f );
1304 float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f };
1306 Size textSize03( 120.0f, 60.0f );
1307 float positions03[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f };
1309 Size textSize04( 110.0f, 60.0f );
1310 float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1312 Size textSize05( 110.0f, 60.0f );
1313 float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1315 Size textSize06( 120.0f, 50.0f );
1316 float positions06[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1318 Size textSize07( 120.0f, 60.0f );
1319 float positions07[] = { 8.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 87.0f, 97.0f, 102.0f, 105.0f, 115.0f };
1321 Size textSize08( 120.0f, 60.0f );
1322 float positions08[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
1324 Size textSize09( 100.0f, 60.0f );
1325 float positions09[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
1327 Size textSize10( 100.0f, 60.0f );
1328 float positions10[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1330 Size textSize11( 120.0f, 60.0f );
1331 float positions11[] = { 117.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 32.0f, 112.0f, 103.0f, 94.0f, 89.0f };
1333 Size textSize12( 110.0f, 60.0f );
1334 float positions12[] = { 109.0f, 102.0f, 89.0f, 80.0f, 72.0f, 66.0f, 56.0f, 50.0f, 46.0f, 37.0f, 29.0f, 23.0f, 14.0f };
1336 Size textSize13( 110.0f, 60.0f );
1337 float positions13[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f, 57.0f, 53.0f, 44.0f, 36.0f, 31.0f, 111.0f };
1339 Size textSize14( 110.0f, 60.0f );
1340 float positions14[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f, 57.0f, 53.0f, 44.0f, 36.0f, 31.0f, 111.0f };
1342 Size textSize15( 120.0f, 60.0f );
1343 float positions15[] = { 130.0f, 118.0f, 113.0f, 111.0f, 105.0f, 101.0f, 91.0f, 83.0f, 78.0f, 69.0f, 62.0f, 58.0f, 54.0f };
1345 Size textSize16( 110.0f, 60.0f );
1346 float positions16[] = { 92.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 32.0f, 29.0f, 18.0f, 13.0f, 8.0f, 6.0f };
1348 Size textSize17( 110.0f, 60.0f );
1349 float positions17[] = { 110.0f, 98.0f, 93.0f, 91.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 34.0f };
1351 Size textSize18( 110.0f, 60.0f );
1352 float positions18[] = { 110.0f, 98.0f, 93.0f, 91.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 34.0f };
1354 Size textSize19( 120.0f, 50.0f );
1355 float positions19[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1357 Size textSize20( 120.0f, 60.0f );
1358 float positions20[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1360 Size textSize21( 120.0f, 60.0f );
1361 float positions21[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1363 Size textSize22( 110.0f, 60.0f );
1364 float positions22[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1366 Size textSize23( 110.0f, 60.0f );
1367 float positions23[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1369 Size textSize24( 120.0f, 60.0f );
1370 float positions24[] = { 142.0f, 135.0f, 121.0f, 113.0f, 104.0f, 98.0f, 88.0f, 83.0f, 78.0f, 70.0f, 61.0f };
1372 Size textSize25( 110.0f, 60.0f );
1373 float positions25[] = { 111.0f, 104.0f, 90.0f, 82.0f, 73.0f, 67.0f, 57.0f, 52.0f, 47.0f, 39.0f, 30.0f, 24.0f, 15.0f, 7.0f };
1375 Size textSize26( 110.0f, 60.0f );
1376 float positions26[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1378 Size textSize27( 110.0f, 60.0f );
1379 float positions27[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1381 Size textSize28( 120.0f, 30.0f );
1382 float positions28[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
1384 Size textSize29( 120.0f, 30.0f );
1385 float positions29[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1387 Size textSize30( 120.0f, 30.0f );
1388 float positions30[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1391 struct ElideData data[] =
1397 DevelText::LineWrap::WORD,
1398 DevelText::EllipsisPosition::END,
1410 DevelText::LineWrap::WORD,
1411 DevelText::EllipsisPosition::START,
1423 DevelText::LineWrap::WORD,
1424 DevelText::EllipsisPosition::MIDDLE,
1435 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR END",
1436 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1438 DevelText::LineWrap::WORD,
1439 DevelText::EllipsisPosition::END,
1448 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR END",
1449 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1451 DevelText::LineWrap::WORD,
1452 DevelText::EllipsisPosition::END,
1461 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR END",
1462 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1464 DevelText::LineWrap::CHARACTER,
1465 DevelText::EllipsisPosition::END,
1474 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR END",
1475 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1477 DevelText::LineWrap::HYPHENATION,
1478 DevelText::EllipsisPosition::END,
1487 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR END",
1488 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1490 DevelText::LineWrap::MIXED,
1491 DevelText::EllipsisPosition::END,
1502 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR START",
1503 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1505 DevelText::LineWrap::WORD,
1506 DevelText::EllipsisPosition::START,
1515 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR START",
1516 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1518 DevelText::LineWrap::WORD,
1519 DevelText::EllipsisPosition::START,
1528 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR START",
1529 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1531 DevelText::LineWrap::CHARACTER,
1532 DevelText::EllipsisPosition::START,
1541 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR START",
1542 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1544 DevelText::LineWrap::HYPHENATION,
1545 DevelText::EllipsisPosition::START,
1554 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR START",
1555 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1557 DevelText::LineWrap::MIXED,
1558 DevelText::EllipsisPosition::START,
1569 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL END",
1570 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1572 DevelText::LineWrap::WORD,
1573 DevelText::EllipsisPosition::END,
1582 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL END",
1583 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1585 DevelText::LineWrap::CHARACTER,
1586 DevelText::EllipsisPosition::END,
1595 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL END",
1596 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1598 DevelText::LineWrap::HYPHENATION,
1599 DevelText::EllipsisPosition::END,
1608 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL END",
1609 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1611 DevelText::LineWrap::MIXED,
1612 DevelText::EllipsisPosition::END,
1623 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL START",
1624 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1626 DevelText::LineWrap::WORD,
1627 DevelText::EllipsisPosition::START,
1636 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL START",
1637 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1639 DevelText::LineWrap::CHARACTER,
1640 DevelText::EllipsisPosition::START,
1649 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL START",
1650 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1652 DevelText::LineWrap::HYPHENATION,
1653 DevelText::EllipsisPosition::START,
1662 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL START",
1663 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1665 DevelText::LineWrap::MIXED,
1666 DevelText::EllipsisPosition::START,
1677 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
1678 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1680 DevelText::LineWrap::WORD,
1681 DevelText::EllipsisPosition::MIDDLE,
1690 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR MIDDLE",
1691 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1693 DevelText::LineWrap::WORD,
1694 DevelText::EllipsisPosition::MIDDLE,
1703 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
1704 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1706 DevelText::LineWrap::CHARACTER,
1707 DevelText::EllipsisPosition::MIDDLE,
1716 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
1717 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1719 DevelText::LineWrap::HYPHENATION,
1720 DevelText::EllipsisPosition::MIDDLE,
1729 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR MIDDLE",
1730 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1732 DevelText::LineWrap::MIXED,
1733 DevelText::EllipsisPosition::MIDDLE,
1744 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL MIDDLE",
1745 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1747 DevelText::LineWrap::WORD,
1748 DevelText::EllipsisPosition::MIDDLE,
1757 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
1758 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1760 DevelText::LineWrap::CHARACTER,
1761 DevelText::EllipsisPosition::MIDDLE,
1770 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
1771 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1773 DevelText::LineWrap::HYPHENATION,
1774 DevelText::EllipsisPosition::MIDDLE,
1783 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL MIDDLE",
1784 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1786 DevelText::LineWrap::MIXED,
1787 DevelText::EllipsisPosition::MIDDLE,
1796 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR END",
1797 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1799 DevelText::LineWrap::WORD,
1800 DevelText::EllipsisPosition::END,
1809 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR START",
1810 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1812 DevelText::LineWrap::WORD,
1813 DevelText::EllipsisPosition::START,
1822 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1823 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1825 DevelText::LineWrap::WORD,
1826 DevelText::EllipsisPosition::MIDDLE,
1835 const unsigned int numberOfTests = 33u;
1837 for( unsigned int index = 0u; index < numberOfTests; ++index )
1839 ToolkitTestApplication application;
1840 if( !ElideTestTextView( data[index] ) )
1842 tet_result(TET_FAIL);
1846 tet_result(TET_PASS);