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 //Test total height of lines is fit inside Controller's size
122 Length heightOfLines = 0;
123 for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
125 const LineRun& tempLine = *( model->GetLines() + lineIndex);
126 heightOfLines+= (tempLine.ascender - tempLine.descender);
129 if(heightOfLines > data.size.height)
131 std::cout << "The heightOfLines should be less than height of controller.";
132 std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <<std::endl;
136 if( numberOfLines != 0u )
138 Length elidedLineIndex = 0u;
139 for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
141 const LineRun& tempLine = *( model->GetLines() + elidedLineIndex);
142 if(tempLine.ellipsis)
144 elidedLineIndex = lineIndex;
148 const LineRun& elidedLine = *( model->GetLines() + elidedLineIndex);
149 Length numberOfLineGlyphs = 0u;
150 Length numberOfLineGlyphsSecondHalf = 0u;
152 switch(data.ellipsisPosition)
154 case DevelText::EllipsisPosition::START:
156 numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
159 case DevelText::EllipsisPosition::MIDDLE:
161 numberOfLineGlyphs = firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u ;
164 case DevelText::EllipsisPosition::END:
167 numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
172 unsigned int index = 0u;
173 for( ; index < numberOfLineGlyphs; ++index )
175 if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
177 std::cout << " different layout :";
178 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
180 std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
182 std::cout << std::endl;
183 std::cout << " expected :";
184 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
186 std::cout << " " << *( data.positions + i );
188 std::cout << std::endl;
194 for( ; index < numberOfLineGlyphsSecondHalf; ++index )
196 if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
198 std::cout << " different layout :";
199 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
201 std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
203 std::cout << std::endl;
204 std::cout << " expected :";
205 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
207 std::cout << " " << *( data.positions + i );
209 std::cout << std::endl;
219 bool ElideTestTextView( const ElideData& data )
221 std::cout << " testing : " << data.description << std::endl;
224 TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
225 fontClient.SetDpi( 93u, 93u );
227 char* pathNamePtr = get_current_dir_name();
228 const std::string pathName( pathNamePtr );
231 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
232 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
233 fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
235 // Creates a text controller.
236 ControllerPtr controller = Controller::New();
238 if(data.isMultiLines)
240 // Configures the text controller similarly to the text-editor.
241 ConfigureTextEditor( controller );
242 controller->SetVerticalScrollEnabled( false );
246 // Configures the text controller similarly to the text-field.
247 ConfigureTextField( controller );
250 controller->SetDefaultFontFamily("TizenSansRegular");
251 controller->SetDefaultFontSize(12.0f, Text::Controller::POINT_SIZE);
253 controller->SetMultiLineEnabled( data.isMultiLines );
254 controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
256 // Sets a text and relais-out.
257 controller->SetMarkupProcessorEnabled( data.isMarkup );
259 controller->SetTextElideEnabled( true );
260 controller->SetEllipsisPosition( data.ellipsisPosition );
262 controller->SetText( data.text );
263 controller->Relayout( data.size );
265 // Get view to elide the glyphs.
266 Text::ViewInterface& view = controller->GetView();
268 Length numberOfGlyphs = view.GetNumberOfGlyphs();
270 if(numberOfGlyphs == 0u)
272 return data.numberOfGlyphs == 0u;
275 Vector<GlyphInfo> glyphs;
276 glyphs.Resize(numberOfGlyphs);
278 Vector<Vector2> positions;
279 positions.Resize(numberOfGlyphs);
281 float alignmentOffset = 0u;
282 numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
288 glyphs.Resize(numberOfGlyphs);
289 positions.Resize(numberOfGlyphs);
292 if( data.numberOfGlyphs != numberOfGlyphs )
294 std::cout << " different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
298 // Tests the text model has been created.
299 const ModelInterface* textModel = controller->GetTextModel();
300 DALI_TEST_CHECK(textModel);
302 if( data.numberOfLines != textModel->GetNumberOfLines() )
304 std::cout << " different number of lines : " << textModel->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
308 const Length numberOfLines = textModel->GetNumberOfLines();
309 const GlyphIndex startIndexOfGlyphs = textModel->GetStartIndexOfElidedGlyphs();
310 const GlyphIndex endIndexOfGlyphs = textModel->GetEndIndexOfElidedGlyphs();
311 const GlyphIndex firstMiddleIndexOfGlyphs = textModel->GetFirstMiddleIndexOfElidedGlyphs();
312 const GlyphIndex secondMiddleIndexOfGlyphs = textModel->GetSecondMiddleIndexOfElidedGlyphs();
314 //Test total height of lines is fit inside Controller's size
315 Length heightOfLines = 0;
316 for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
318 const LineRun& tempLine = *( textModel->GetLines() + lineIndex);
319 heightOfLines+= (tempLine.ascender - tempLine.descender);
322 if(heightOfLines > data.size.height)
324 std::cout << "The heightOfLines should be less than height of controller.";
325 std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <<std::endl;
329 if( numberOfLines != 0u )
331 Length elidedLineIndex = 0u;
332 for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
334 const LineRun& tempLine = *( textModel->GetLines() + lineIndex);
335 if(tempLine.ellipsis)
337 elidedLineIndex = lineIndex;
341 const LineRun& elidedLine = *( textModel->GetLines() + elidedLineIndex);
343 Length numberOfLineGlyphs = 0u;
344 Length numberOfLineGlyphsSecondHalf = 0u;
346 switch(data.ellipsisPosition)
348 case DevelText::EllipsisPosition::START:
350 numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
353 case DevelText::EllipsisPosition::MIDDLE:
355 numberOfLineGlyphs = firstMiddleIndexOfGlyphs == elidedLine.glyphRun.glyphIndex ? 0u : (firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u);
357 if(elidedLine.isSplitToTwoHalves)
359 numberOfLineGlyphsSecondHalf = (elidedLine.glyphRunSecondHalf.glyphIndex + elidedLine.glyphRunSecondHalf.numberOfGlyphs) - secondMiddleIndexOfGlyphs ;
364 case DevelText::EllipsisPosition::END:
367 numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
373 unsigned int index = 0u;
374 for( ; index < numberOfLineGlyphs; ++index )
377 if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
379 std::cout << " different layout :";
380 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
382 std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
384 std::cout << std::endl;
385 std::cout << " expected :";
386 for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
388 std::cout << " " << *( data.positions + i );
390 std::cout << std::endl;
395 for( ; index < numberOfLineGlyphsSecondHalf; ++index )
397 if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
399 std::cout << " different layout :";
400 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
402 std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
404 std::cout << std::endl;
405 std::cout << " expected :";
406 for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
408 std::cout << " " << *( data.positions + i );
410 std::cout << std::endl;
421 int UtcDaliTextLabelElideTextLocation(void)
423 tet_infoline(" UtcDaliTextLabelElideTextLocation ");
425 Size textSize00( 100.f, 100.f );
427 Size textSize01( 120.0f, 50.0f );
428 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
430 Size textSize02( 120.0f, 50.0f );
431 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 };
433 Size textSize03( 120.0f, 60.0f );
434 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 };
436 Size textSize04( 120.0f, 60.0f );
437 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 };
439 Size textSize05( 110.0f, 60.0f );
440 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 };
442 Size textSize06( 110.0f, 60.0f );
443 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 };
445 Size textSize07( 120.0f, 50.0f );
446 float positions07[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
448 Size textSize08( 120.0f, 50.0f );
449 float positions08[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
451 Size textSize09( 120.0f, 60.0f );
452 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 };
454 Size textSize10( 120.0f, 60.0f );
455 float positions10[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
457 Size textSize11( 100.0f, 60.0f );
458 float positions11[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
460 Size textSize12( 100.0f, 60.0f );
461 float positions12[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
463 Size textSize13( 120.0f, 60.0f );
464 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 };
466 Size textSize14( 120.0f, 60.0f );
467 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 };
469 Size textSize15( 110.0f, 60.0f );
470 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 };
472 Size textSize16( 110.0f, 60.0f );
473 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 };
475 Size textSize17( 110.0f, 60.0f );
476 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 };
478 Size textSize18( 120.0f, 60.0f );
479 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 };
481 Size textSize19( 120.0f, 60.0f );
482 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 };
484 Size textSize20( 110.0f, 60.0f );
485 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 };
487 Size textSize21( 110.0f, 60.0f );
488 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 };
490 Size textSize22( 110.0f, 60.0f );
491 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 };
493 Size textSize23( 120.0f, 50.0f );
494 float positions23[] = { 0.0f, 11.0f, 20.0f, 32.0f, 44.0f };
496 Size textSize24( 120.0f, 50.0f );
497 float positions24[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
499 Size textSize25( 120.0f, 60.0f );
500 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 };
502 Size textSize26( 120.0f, 60.0f );
503 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 };
505 Size textSize27( 110.0f, 60.0f );
506 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 };
508 Size textSize28( 110.0f, 60.0f );
509 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 };
511 Size textSize29( 120.0f, 60.0f );
512 float positions29[] = { 115.0f, 108.0f, 94.0f, 86.0f, 78.0f, 72.0f, 61.0f };
514 Size textSize30( 120.0f, 60.0f );
515 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 };
517 Size textSize31( 110.0f, 60.0f );
518 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 };
520 Size textSize32( 110.0f, 60.0f );
521 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 };
523 Size textSize33( 110.0f, 60.0f );
524 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 };
526 Size textSize34( 120.0f, 30.0f );
527 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 };
529 Size textSize35( 120.0f, 30.0f );
530 float positions35[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
532 Size textSize36( 120.0f, 30.0f );
533 float positions36[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
535 struct ElideData data[] =
541 DevelText::LineWrap::WORD,
542 DevelText::EllipsisPosition::END,
554 DevelText::LineWrap::WORD,
555 DevelText::EllipsisPosition::START,
567 DevelText::LineWrap::WORD,
568 DevelText::EllipsisPosition::MIDDLE,
578 "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
579 "A0123456789 B0123456789 C0123456789 D0123456789 ",
581 DevelText::LineWrap::WORD,
582 DevelText::EllipsisPosition::END,
591 "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
592 "A0123456789 B0123456789 C0123456789 D0123456789 ",
594 DevelText::LineWrap::WORD,
595 DevelText::EllipsisPosition::END,
604 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
605 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
607 DevelText::LineWrap::WORD,
608 DevelText::EllipsisPosition::END,
617 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
618 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
620 DevelText::LineWrap::CHARACTER,
621 DevelText::EllipsisPosition::END,
630 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
631 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
633 DevelText::LineWrap::HYPHENATION,
634 DevelText::EllipsisPosition::END,
643 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
644 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
646 DevelText::LineWrap::MIXED,
647 DevelText::EllipsisPosition::END,
657 "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
658 "A0123456789 B0123456789 C0123456789 D0123456789 ",
660 DevelText::LineWrap::WORD,
661 DevelText::EllipsisPosition::START,
670 "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
671 "A0123456789 B0123456789 C0123456789 D0123456789 ",
673 DevelText::LineWrap::WORD,
674 DevelText::EllipsisPosition::START,
683 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
684 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
686 DevelText::LineWrap::WORD,
687 DevelText::EllipsisPosition::START,
696 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
697 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
699 DevelText::LineWrap::CHARACTER,
700 DevelText::EllipsisPosition::START,
709 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
710 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
712 DevelText::LineWrap::HYPHENATION,
713 DevelText::EllipsisPosition::START,
722 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
723 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
725 DevelText::LineWrap::MIXED,
726 DevelText::EllipsisPosition::START,
736 "EllipsisPosition: TextLabel: SingleLine RTL END",
737 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
739 DevelText::LineWrap::WORD,
740 DevelText::EllipsisPosition::END,
749 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
750 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
752 DevelText::LineWrap::WORD,
753 DevelText::EllipsisPosition::END,
762 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
763 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
765 DevelText::LineWrap::CHARACTER,
766 DevelText::EllipsisPosition::END,
775 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
776 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
778 DevelText::LineWrap::HYPHENATION,
779 DevelText::EllipsisPosition::END,
788 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
789 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
791 DevelText::LineWrap::MIXED,
792 DevelText::EllipsisPosition::END,
802 "EllipsisPosition: TextLabel: SingleLine RTL START",
803 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
805 DevelText::LineWrap::WORD,
806 DevelText::EllipsisPosition::START,
815 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
816 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
818 DevelText::LineWrap::WORD,
819 DevelText::EllipsisPosition::START,
828 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
829 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
831 DevelText::LineWrap::CHARACTER,
832 DevelText::EllipsisPosition::START,
841 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
842 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
844 DevelText::LineWrap::HYPHENATION,
845 DevelText::EllipsisPosition::START,
854 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
855 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
857 DevelText::LineWrap::MIXED,
858 DevelText::EllipsisPosition::START,
868 "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
869 "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
871 DevelText::LineWrap::WORD,
872 DevelText::EllipsisPosition::MIDDLE,
881 "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
882 "A0123456789 B0123456789 C0123456789 D0123456789 ",
884 DevelText::LineWrap::WORD,
885 DevelText::EllipsisPosition::MIDDLE,
894 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
895 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
897 DevelText::LineWrap::WORD,
898 DevelText::EllipsisPosition::MIDDLE,
907 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
908 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
910 DevelText::LineWrap::CHARACTER,
911 DevelText::EllipsisPosition::MIDDLE,
920 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
921 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
923 DevelText::LineWrap::HYPHENATION,
924 DevelText::EllipsisPosition::MIDDLE,
933 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
934 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
936 DevelText::LineWrap::MIXED,
937 DevelText::EllipsisPosition::MIDDLE,
947 "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
948 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
950 DevelText::LineWrap::WORD,
951 DevelText::EllipsisPosition::MIDDLE,
960 "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
961 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
963 DevelText::LineWrap::WORD,
964 DevelText::EllipsisPosition::MIDDLE,
973 "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
974 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
976 DevelText::LineWrap::CHARACTER,
977 DevelText::EllipsisPosition::MIDDLE,
986 "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
987 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
989 DevelText::LineWrap::HYPHENATION,
990 DevelText::EllipsisPosition::MIDDLE,
999 "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
1000 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1002 DevelText::LineWrap::MIXED,
1003 DevelText::EllipsisPosition::MIDDLE,
1012 "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
1013 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1015 DevelText::LineWrap::WORD,
1016 DevelText::EllipsisPosition::END,
1025 "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
1026 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1028 DevelText::LineWrap::WORD,
1029 DevelText::EllipsisPosition::START,
1038 "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1039 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1041 DevelText::LineWrap::WORD,
1042 DevelText::EllipsisPosition::MIDDLE,
1051 const unsigned int numberOfTests = 39u;
1053 for( unsigned int index = 0u; index < numberOfTests; ++index )
1055 ToolkitTestApplication application;
1056 if( !ElideTestViewModel( data[index] ) )
1058 tet_result(TET_FAIL);
1062 tet_result(TET_PASS);
1067 int UtcDaliTextFieldlElideTextLocation(void)
1069 tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
1071 Size textSize00( 100.f, 100.f );
1073 Size textSize01( 120.0f, 50.0f );
1074 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1076 Size textSize02( 120.0f, 50.0f );
1077 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 };
1079 Size textSize03( 120.0f, 50.0f );
1080 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 };
1082 Size textSize04( 120.0f, 50.0f );
1083 float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1085 Size textSize05( 120.0f, 50.0f );
1086 float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1088 Size textSize06( 120.0f, 50.0f );
1089 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 };
1091 Size textSize07( 120.0f, 50.0f );
1092 float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f };
1094 Size textSize08( 120.0f, 50.0f );
1095 float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1097 Size textSize09( 120.0f, 50.0f );
1098 float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f };
1100 Size textSize10( 120.0f, 50.0f );
1101 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 };
1103 Size textSize11( 120.0f, 50.0f );
1104 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 };
1106 Size textSize12( 120.0f, 50.0f );
1107 float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f };
1109 struct ElideData data[] =
1115 DevelText::LineWrap::WORD,
1116 DevelText::EllipsisPosition::END,
1128 DevelText::LineWrap::WORD,
1129 DevelText::EllipsisPosition::START,
1141 DevelText::LineWrap::WORD,
1142 DevelText::EllipsisPosition::MIDDLE,
1151 "EllipsisPosition: TextField: Basic case SingleLine LTR END",
1152 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1154 DevelText::LineWrap::WORD,
1155 DevelText::EllipsisPosition::END,
1164 "EllipsisPosition: TextField: SingleLine LTR END",
1165 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1167 DevelText::LineWrap::WORD,
1168 DevelText::EllipsisPosition::END,
1177 "EllipsisPosition: TextField: SingleLine RTL END",
1178 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1180 DevelText::LineWrap::WORD,
1181 DevelText::EllipsisPosition::END,
1190 "EllipsisPosition: TextField: Basic case SingleLine LTR START",
1191 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1193 DevelText::LineWrap::WORD,
1194 DevelText::EllipsisPosition::START,
1203 "EllipsisPosition: TextField: SingleLine LTR START",
1204 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1206 DevelText::LineWrap::WORD,
1207 DevelText::EllipsisPosition::START,
1216 "EllipsisPosition: TextField: SingleLine RTL START",
1217 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1219 DevelText::LineWrap::WORD,
1220 DevelText::EllipsisPosition::START,
1229 "EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
1230 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1232 DevelText::LineWrap::WORD,
1233 DevelText::EllipsisPosition::MIDDLE,
1242 "EllipsisPosition: TextField: SingleLine LTR MIDDLE",
1243 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
1245 DevelText::LineWrap::WORD,
1246 DevelText::EllipsisPosition::MIDDLE,
1255 "EllipsisPosition: TextField: SingleLine RTL MIDDLE",
1256 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1258 DevelText::LineWrap::WORD,
1259 DevelText::EllipsisPosition::MIDDLE,
1268 "EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
1269 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1271 DevelText::LineWrap::WORD,
1272 DevelText::EllipsisPosition::END,
1281 "EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
1282 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1284 DevelText::LineWrap::WORD,
1285 DevelText::EllipsisPosition::START,
1294 "EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
1295 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1297 DevelText::LineWrap::WORD,
1298 DevelText::EllipsisPosition::MIDDLE,
1308 const unsigned int numberOfTests = 15u;
1310 for( unsigned int index = 0u; index < numberOfTests; ++index )
1312 ToolkitTestApplication application;
1313 if( !ElideTestTextView( data[index] ) )
1315 tet_result(TET_FAIL);
1318 tet_result(TET_PASS);
1324 int UtcDaliTextEditorElideTextLocation(void)
1326 tet_infoline(" UtcDaliTextEditorElideTextLocation ");
1328 Size textSize00( 100.f, 100.f );
1330 Size textSize01( 120.0f, 50.0f );
1331 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f };
1333 Size textSize02( 120.0f, 60.0f );
1334 float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f };
1336 Size textSize03( 120.0f, 60.0f );
1337 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 };
1339 Size textSize04( 110.0f, 60.0f );
1340 float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1342 Size textSize05( 110.0f, 60.0f );
1343 float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1345 Size textSize06( 120.0f, 50.0f );
1346 float positions06[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1348 Size textSize07( 120.0f, 60.0f );
1349 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 };
1351 Size textSize08( 120.0f, 60.0f );
1352 float positions08[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
1354 Size textSize09( 100.0f, 60.0f );
1355 float positions09[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
1357 Size textSize10( 100.0f, 60.0f );
1358 float positions10[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1360 Size textSize11( 120.0f, 60.0f );
1361 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 };
1363 Size textSize12( 110.0f, 60.0f );
1364 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 };
1366 Size textSize13( 110.0f, 60.0f );
1367 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 };
1369 Size textSize14( 110.0f, 60.0f );
1370 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 };
1372 Size textSize15( 120.0f, 60.0f );
1373 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 };
1375 Size textSize16( 110.0f, 60.0f );
1376 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 };
1378 Size textSize17( 110.0f, 60.0f );
1379 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 };
1381 Size textSize18( 110.0f, 60.0f );
1382 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 };
1384 Size textSize19( 120.0f, 50.0f );
1385 float positions19[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1387 Size textSize20( 120.0f, 60.0f );
1388 float positions20[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1390 Size textSize21( 120.0f, 60.0f );
1391 float positions21[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1393 Size textSize22( 110.0f, 60.0f );
1394 float positions22[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1396 Size textSize23( 110.0f, 60.0f );
1397 float positions23[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1399 Size textSize24( 120.0f, 60.0f );
1400 float positions24[] = { 142.0f, 135.0f, 121.0f, 113.0f, 104.0f, 98.0f, 88.0f, 83.0f, 78.0f, 70.0f, 61.0f };
1402 Size textSize25( 110.0f, 60.0f );
1403 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 };
1405 Size textSize26( 110.0f, 60.0f );
1406 float positions26[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1408 Size textSize27( 110.0f, 60.0f );
1409 float positions27[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1411 Size textSize28( 120.0f, 30.0f );
1412 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 };
1414 Size textSize29( 120.0f, 30.0f );
1415 float positions29[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1417 Size textSize30( 120.0f, 30.0f );
1418 float positions30[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1421 struct ElideData data[] =
1427 DevelText::LineWrap::WORD,
1428 DevelText::EllipsisPosition::END,
1440 DevelText::LineWrap::WORD,
1441 DevelText::EllipsisPosition::START,
1453 DevelText::LineWrap::WORD,
1454 DevelText::EllipsisPosition::MIDDLE,
1465 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR END",
1466 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1468 DevelText::LineWrap::WORD,
1469 DevelText::EllipsisPosition::END,
1478 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR END",
1479 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1481 DevelText::LineWrap::WORD,
1482 DevelText::EllipsisPosition::END,
1491 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR END",
1492 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1494 DevelText::LineWrap::CHARACTER,
1495 DevelText::EllipsisPosition::END,
1504 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR END",
1505 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1507 DevelText::LineWrap::HYPHENATION,
1508 DevelText::EllipsisPosition::END,
1517 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR END",
1518 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1520 DevelText::LineWrap::MIXED,
1521 DevelText::EllipsisPosition::END,
1532 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR START",
1533 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1535 DevelText::LineWrap::WORD,
1536 DevelText::EllipsisPosition::START,
1545 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR START",
1546 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1548 DevelText::LineWrap::WORD,
1549 DevelText::EllipsisPosition::START,
1558 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR START",
1559 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1561 DevelText::LineWrap::CHARACTER,
1562 DevelText::EllipsisPosition::START,
1571 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR START",
1572 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1574 DevelText::LineWrap::HYPHENATION,
1575 DevelText::EllipsisPosition::START,
1584 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR START",
1585 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1587 DevelText::LineWrap::MIXED,
1588 DevelText::EllipsisPosition::START,
1599 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL END",
1600 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1602 DevelText::LineWrap::WORD,
1603 DevelText::EllipsisPosition::END,
1612 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL END",
1613 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1615 DevelText::LineWrap::CHARACTER,
1616 DevelText::EllipsisPosition::END,
1625 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL END",
1626 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1628 DevelText::LineWrap::HYPHENATION,
1629 DevelText::EllipsisPosition::END,
1638 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL END",
1639 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1641 DevelText::LineWrap::MIXED,
1642 DevelText::EllipsisPosition::END,
1653 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL START",
1654 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1656 DevelText::LineWrap::WORD,
1657 DevelText::EllipsisPosition::START,
1666 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL START",
1667 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1669 DevelText::LineWrap::CHARACTER,
1670 DevelText::EllipsisPosition::START,
1679 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL START",
1680 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1682 DevelText::LineWrap::HYPHENATION,
1683 DevelText::EllipsisPosition::START,
1692 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL START",
1693 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1695 DevelText::LineWrap::MIXED,
1696 DevelText::EllipsisPosition::START,
1707 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
1708 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1710 DevelText::LineWrap::WORD,
1711 DevelText::EllipsisPosition::MIDDLE,
1720 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR MIDDLE",
1721 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1723 DevelText::LineWrap::WORD,
1724 DevelText::EllipsisPosition::MIDDLE,
1733 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
1734 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1736 DevelText::LineWrap::CHARACTER,
1737 DevelText::EllipsisPosition::MIDDLE,
1746 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
1747 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1749 DevelText::LineWrap::HYPHENATION,
1750 DevelText::EllipsisPosition::MIDDLE,
1759 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR MIDDLE",
1760 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1762 DevelText::LineWrap::MIXED,
1763 DevelText::EllipsisPosition::MIDDLE,
1774 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL MIDDLE",
1775 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1777 DevelText::LineWrap::WORD,
1778 DevelText::EllipsisPosition::MIDDLE,
1787 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
1788 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1790 DevelText::LineWrap::CHARACTER,
1791 DevelText::EllipsisPosition::MIDDLE,
1800 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
1801 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1803 DevelText::LineWrap::HYPHENATION,
1804 DevelText::EllipsisPosition::MIDDLE,
1813 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL MIDDLE",
1814 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1816 DevelText::LineWrap::MIXED,
1817 DevelText::EllipsisPosition::MIDDLE,
1826 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR END",
1827 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1829 DevelText::LineWrap::WORD,
1830 DevelText::EllipsisPosition::END,
1839 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR START",
1840 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1842 DevelText::LineWrap::WORD,
1843 DevelText::EllipsisPosition::START,
1852 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1853 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1855 DevelText::LineWrap::WORD,
1856 DevelText::EllipsisPosition::MIDDLE,
1865 const unsigned int numberOfTests = 33u;
1867 for( unsigned int index = 0u; index < numberOfTests; ++index )
1869 ToolkitTestApplication application;
1870 if( !ElideTestTextView( data[index] ) )
1872 tet_result(TET_FAIL);
1876 tet_result(TET_PASS);