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 <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/controller/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 Size textSize37(145.0f, 30.0f);
536 float positions37[] = {131.0f, 126.0f, 121.0f, 116.0f, 108.0f, 103.0f, 93.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f};
538 Size textSize38(145.0f, 30.0f);
539 float positions38[] = {51.0f, 66.0f, 71.0f, 79.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 27.0f, 23.0f, 14.0f, 10.0f, 0.0f};
541 struct ElideData data[] =
546 DevelText::LineWrap::WORD,
547 DevelText::EllipsisPosition::END,
557 DevelText::LineWrap::WORD,
558 DevelText::EllipsisPosition::START,
568 DevelText::LineWrap::WORD,
569 DevelText::EllipsisPosition::MIDDLE,
578 "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
579 "A0123456789 B0123456789 C0123456789 D0123456789 ",
581 DevelText::LineWrap::WORD,
582 DevelText::EllipsisPosition::END,
589 {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
590 "A0123456789 B0123456789 C0123456789 D0123456789 ",
592 DevelText::LineWrap::WORD,
593 DevelText::EllipsisPosition::END,
600 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
601 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
603 DevelText::LineWrap::WORD,
604 DevelText::EllipsisPosition::END,
611 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
612 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
614 DevelText::LineWrap::CHARACTER,
615 DevelText::EllipsisPosition::END,
622 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
623 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
625 DevelText::LineWrap::HYPHENATION,
626 DevelText::EllipsisPosition::END,
633 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
634 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
636 DevelText::LineWrap::MIXED,
637 DevelText::EllipsisPosition::END,
646 "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
647 "A0123456789 B0123456789 C0123456789 D0123456789 ",
649 DevelText::LineWrap::WORD,
650 DevelText::EllipsisPosition::START,
659 {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
660 "A0123456789 B0123456789 C0123456789 D0123456789 ",
662 DevelText::LineWrap::WORD,
663 DevelText::EllipsisPosition::START,
670 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
671 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
673 DevelText::LineWrap::WORD,
674 DevelText::EllipsisPosition::START,
681 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
682 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
684 DevelText::LineWrap::CHARACTER,
685 DevelText::EllipsisPosition::START,
692 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
693 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
695 DevelText::LineWrap::HYPHENATION,
696 DevelText::EllipsisPosition::START,
703 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
704 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
706 DevelText::LineWrap::MIXED,
707 DevelText::EllipsisPosition::START,
716 "EllipsisPosition: TextLabel: SingleLine RTL END",
717 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
719 DevelText::LineWrap::WORD,
720 DevelText::EllipsisPosition::END,
727 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
728 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
730 DevelText::LineWrap::WORD,
731 DevelText::EllipsisPosition::END,
738 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
739 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
741 DevelText::LineWrap::CHARACTER,
742 DevelText::EllipsisPosition::END,
749 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
750 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
752 DevelText::LineWrap::HYPHENATION,
753 DevelText::EllipsisPosition::END,
760 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
761 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
763 DevelText::LineWrap::MIXED,
764 DevelText::EllipsisPosition::END,
773 "EllipsisPosition: TextLabel: SingleLine RTL START",
774 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
776 DevelText::LineWrap::WORD,
777 DevelText::EllipsisPosition::START,
784 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
785 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
787 DevelText::LineWrap::WORD,
788 DevelText::EllipsisPosition::START,
795 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
796 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
798 DevelText::LineWrap::CHARACTER,
799 DevelText::EllipsisPosition::START,
806 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
807 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
809 DevelText::LineWrap::HYPHENATION,
810 DevelText::EllipsisPosition::START,
817 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
818 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
820 DevelText::LineWrap::MIXED,
821 DevelText::EllipsisPosition::START,
830 "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
831 "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
833 DevelText::LineWrap::WORD,
834 DevelText::EllipsisPosition::MIDDLE,
841 {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
842 "A0123456789 B0123456789 C0123456789 D0123456789 ",
844 DevelText::LineWrap::WORD,
845 DevelText::EllipsisPosition::MIDDLE,
852 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
853 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
855 DevelText::LineWrap::WORD,
856 DevelText::EllipsisPosition::MIDDLE,
863 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
864 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
866 DevelText::LineWrap::CHARACTER,
867 DevelText::EllipsisPosition::MIDDLE,
874 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
875 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
877 DevelText::LineWrap::HYPHENATION,
878 DevelText::EllipsisPosition::MIDDLE,
885 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
886 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
888 DevelText::LineWrap::MIXED,
889 DevelText::EllipsisPosition::MIDDLE,
898 "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
899 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
901 DevelText::LineWrap::WORD,
902 DevelText::EllipsisPosition::MIDDLE,
909 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
910 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
912 DevelText::LineWrap::WORD,
913 DevelText::EllipsisPosition::MIDDLE,
920 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
921 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
923 DevelText::LineWrap::CHARACTER,
924 DevelText::EllipsisPosition::MIDDLE,
931 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
932 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
934 DevelText::LineWrap::HYPHENATION,
935 DevelText::EllipsisPosition::MIDDLE,
942 {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
943 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
945 DevelText::LineWrap::MIXED,
946 DevelText::EllipsisPosition::MIDDLE,
953 {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
954 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
956 DevelText::LineWrap::WORD,
957 DevelText::EllipsisPosition::END,
964 {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
965 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
967 DevelText::LineWrap::WORD,
968 DevelText::EllipsisPosition::START,
975 {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
976 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
978 DevelText::LineWrap::WORD,
979 DevelText::EllipsisPosition::MIDDLE,
986 {"EllipsisPosition: TextLabel: Mixed Directions Languages END",
987 "سیٹنگیں Projector سیٹنگیں",
989 DevelText::LineWrap::WORD,
990 DevelText::EllipsisPosition::END,
997 {"EllipsisPosition: TextLabel: Mixed Directions Languages START",
998 "سیٹنگیں Projector سیٹنگیں",
1000 DevelText::LineWrap::WORD,
1001 DevelText::EllipsisPosition::START,
1009 const unsigned int numberOfTests = 41u;
1011 for( unsigned int index = 0u; index < numberOfTests; ++index )
1013 ToolkitTestApplication application;
1014 if( !ElideTestViewModel( data[index] ) )
1016 tet_result(TET_FAIL);
1020 tet_result(TET_PASS);
1025 int UtcDaliTextFieldlElideTextLocation(void)
1027 tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
1029 Size textSize00( 100.f, 100.f );
1031 Size textSize01( 120.0f, 50.0f );
1032 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1034 Size textSize02( 120.0f, 50.0f );
1035 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 };
1037 Size textSize03( 120.0f, 50.0f );
1038 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 };
1040 Size textSize04( 120.0f, 50.0f );
1041 float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1043 Size textSize05( 120.0f, 50.0f );
1044 float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1046 Size textSize06( 120.0f, 50.0f );
1047 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 };
1049 Size textSize07( 120.0f, 50.0f );
1050 float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f };
1052 Size textSize08( 120.0f, 50.0f );
1053 float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1055 Size textSize09( 120.0f, 50.0f );
1056 float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f };
1058 Size textSize10( 120.0f, 50.0f );
1059 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 };
1061 Size textSize11( 120.0f, 50.0f );
1062 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 };
1064 Size textSize12( 120.0f, 50.0f );
1065 float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f };
1067 Size textSize13(145.0f, 30.0f);
1068 float positions13[] = {131.0f, 126.0f, 121.0f, 117.0f, 108.0f, 104.0f, 94.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f};
1070 Size textSize14(145.0f, 30.0f);
1071 float positions14[] = {51.0f, 66.0f, 71.0f, 80.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 28.0f, 23.0f, 14.0f, 10.0f, 0.0f};
1073 struct ElideData data[] =
1078 DevelText::LineWrap::WORD,
1079 DevelText::EllipsisPosition::END,
1089 DevelText::LineWrap::WORD,
1090 DevelText::EllipsisPosition::START,
1100 DevelText::LineWrap::WORD,
1101 DevelText::EllipsisPosition::MIDDLE,
1108 {"EllipsisPosition: TextField: Basic case SingleLine LTR END",
1109 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1111 DevelText::LineWrap::WORD,
1112 DevelText::EllipsisPosition::END,
1119 {"EllipsisPosition: TextField: SingleLine LTR END",
1120 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
1122 DevelText::LineWrap::WORD,
1123 DevelText::EllipsisPosition::END,
1130 {"EllipsisPosition: TextField: SingleLine RTL END",
1131 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1133 DevelText::LineWrap::WORD,
1134 DevelText::EllipsisPosition::END,
1141 {"EllipsisPosition: TextField: Basic case SingleLine LTR START",
1142 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1144 DevelText::LineWrap::WORD,
1145 DevelText::EllipsisPosition::START,
1152 {"EllipsisPosition: TextField: SingleLine LTR START",
1153 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
1155 DevelText::LineWrap::WORD,
1156 DevelText::EllipsisPosition::START,
1163 {"EllipsisPosition: TextField: SingleLine RTL START",
1164 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1166 DevelText::LineWrap::WORD,
1167 DevelText::EllipsisPosition::START,
1174 {"EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
1175 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1177 DevelText::LineWrap::WORD,
1178 DevelText::EllipsisPosition::MIDDLE,
1185 {"EllipsisPosition: TextField: SingleLine LTR MIDDLE",
1186 "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
1188 DevelText::LineWrap::WORD,
1189 DevelText::EllipsisPosition::MIDDLE,
1196 {"EllipsisPosition: TextField: SingleLine RTL MIDDLE",
1197 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1199 DevelText::LineWrap::WORD,
1200 DevelText::EllipsisPosition::MIDDLE,
1207 {"EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
1208 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1210 DevelText::LineWrap::WORD,
1211 DevelText::EllipsisPosition::END,
1218 {"EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
1219 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1221 DevelText::LineWrap::WORD,
1222 DevelText::EllipsisPosition::START,
1229 {"EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
1230 " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ",
1232 DevelText::LineWrap::WORD,
1233 DevelText::EllipsisPosition::MIDDLE,
1240 {"EllipsisPosition: TextField: Mixed Directions Languages END",
1241 "سیٹنگیں Projector سیٹنگیں",
1243 DevelText::LineWrap::WORD,
1244 DevelText::EllipsisPosition::END,
1251 {"EllipsisPosition: TextField: Mixed Directions Languages START",
1252 "سیٹنگیں Projector سیٹنگیں",
1254 DevelText::LineWrap::WORD,
1255 DevelText::EllipsisPosition::START,
1264 const unsigned int numberOfTests = 17u;
1266 for( unsigned int index = 0u; index < numberOfTests; ++index )
1268 ToolkitTestApplication application;
1269 if( !ElideTestTextView( data[index] ) )
1271 tet_result(TET_FAIL);
1274 tet_result(TET_PASS);
1280 int UtcDaliTextEditorElideTextLocation(void)
1282 tet_infoline(" UtcDaliTextEditorElideTextLocation ");
1284 Size textSize00( 100.f, 100.f );
1286 Size textSize01( 120.0f, 50.0f );
1287 float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f };
1289 Size textSize02( 120.0f, 60.0f );
1290 float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f };
1292 Size textSize03( 120.0f, 60.0f );
1293 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 };
1295 Size textSize04( 110.0f, 60.0f );
1296 float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1298 Size textSize05( 110.0f, 60.0f );
1299 float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1301 Size textSize06( 120.0f, 50.0f );
1302 float positions06[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1304 Size textSize07( 120.0f, 60.0f );
1305 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 };
1307 Size textSize08( 120.0f, 60.0f );
1308 float positions08[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
1310 Size textSize09( 100.0f, 60.0f );
1311 float positions09[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
1313 Size textSize10( 100.0f, 60.0f );
1314 float positions10[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1316 Size textSize11( 120.0f, 60.0f );
1317 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 };
1319 Size textSize12( 110.0f, 60.0f );
1320 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 };
1322 Size textSize13( 110.0f, 60.0f );
1323 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 };
1325 Size textSize14( 110.0f, 60.0f );
1326 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 };
1328 Size textSize15( 120.0f, 60.0f );
1329 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 };
1331 Size textSize16( 110.0f, 60.0f );
1332 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 };
1334 Size textSize17( 110.0f, 60.0f );
1335 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 };
1337 Size textSize18( 110.0f, 60.0f );
1338 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 };
1340 Size textSize19( 120.0f, 50.0f );
1341 float positions19[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1343 Size textSize20( 120.0f, 60.0f );
1344 float positions20[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1346 Size textSize21( 120.0f, 60.0f );
1347 float positions21[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1349 Size textSize22( 110.0f, 60.0f );
1350 float positions22[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1352 Size textSize23( 110.0f, 60.0f );
1353 float positions23[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1355 Size textSize24( 120.0f, 60.0f );
1356 float positions24[] = { 142.0f, 135.0f, 121.0f, 113.0f, 104.0f, 98.0f, 88.0f, 83.0f, 78.0f, 70.0f, 61.0f };
1358 Size textSize25( 110.0f, 60.0f );
1359 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 };
1361 Size textSize26( 110.0f, 60.0f );
1362 float positions26[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1364 Size textSize27( 110.0f, 60.0f );
1365 float positions27[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1367 Size textSize28( 120.0f, 30.0f );
1368 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 };
1370 Size textSize29( 120.0f, 30.0f );
1371 float positions29[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1373 Size textSize30( 120.0f, 30.0f );
1374 float positions30[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1377 struct ElideData data[] =
1383 DevelText::LineWrap::WORD,
1384 DevelText::EllipsisPosition::END,
1396 DevelText::LineWrap::WORD,
1397 DevelText::EllipsisPosition::START,
1409 DevelText::LineWrap::WORD,
1410 DevelText::EllipsisPosition::MIDDLE,
1421 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR END",
1422 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1424 DevelText::LineWrap::WORD,
1425 DevelText::EllipsisPosition::END,
1434 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR END",
1435 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1437 DevelText::LineWrap::WORD,
1438 DevelText::EllipsisPosition::END,
1447 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR END",
1448 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1450 DevelText::LineWrap::CHARACTER,
1451 DevelText::EllipsisPosition::END,
1460 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR END",
1461 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1463 DevelText::LineWrap::HYPHENATION,
1464 DevelText::EllipsisPosition::END,
1473 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR END",
1474 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1476 DevelText::LineWrap::MIXED,
1477 DevelText::EllipsisPosition::END,
1488 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR START",
1489 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1491 DevelText::LineWrap::WORD,
1492 DevelText::EllipsisPosition::START,
1501 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR START",
1502 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1504 DevelText::LineWrap::WORD,
1505 DevelText::EllipsisPosition::START,
1514 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR START",
1515 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1517 DevelText::LineWrap::CHARACTER,
1518 DevelText::EllipsisPosition::START,
1527 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR START",
1528 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1530 DevelText::LineWrap::HYPHENATION,
1531 DevelText::EllipsisPosition::START,
1540 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR START",
1541 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1543 DevelText::LineWrap::MIXED,
1544 DevelText::EllipsisPosition::START,
1555 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL END",
1556 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1558 DevelText::LineWrap::WORD,
1559 DevelText::EllipsisPosition::END,
1568 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL END",
1569 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1571 DevelText::LineWrap::CHARACTER,
1572 DevelText::EllipsisPosition::END,
1581 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL END",
1582 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1584 DevelText::LineWrap::HYPHENATION,
1585 DevelText::EllipsisPosition::END,
1594 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL END",
1595 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1597 DevelText::LineWrap::MIXED,
1598 DevelText::EllipsisPosition::END,
1609 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL START",
1610 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1612 DevelText::LineWrap::WORD,
1613 DevelText::EllipsisPosition::START,
1622 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL START",
1623 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1625 DevelText::LineWrap::CHARACTER,
1626 DevelText::EllipsisPosition::START,
1635 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL START",
1636 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1638 DevelText::LineWrap::HYPHENATION,
1639 DevelText::EllipsisPosition::START,
1648 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL START",
1649 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1651 DevelText::LineWrap::MIXED,
1652 DevelText::EllipsisPosition::START,
1663 "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
1664 "A0123456789 B0123456789 C0123456789 D0123456789 ",
1666 DevelText::LineWrap::WORD,
1667 DevelText::EllipsisPosition::MIDDLE,
1676 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR MIDDLE",
1677 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1679 DevelText::LineWrap::WORD,
1680 DevelText::EllipsisPosition::MIDDLE,
1689 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
1690 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1692 DevelText::LineWrap::CHARACTER,
1693 DevelText::EllipsisPosition::MIDDLE,
1702 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
1703 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1705 DevelText::LineWrap::HYPHENATION,
1706 DevelText::EllipsisPosition::MIDDLE,
1715 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR MIDDLE",
1716 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1718 DevelText::LineWrap::MIXED,
1719 DevelText::EllipsisPosition::MIDDLE,
1730 "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL MIDDLE",
1731 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1733 DevelText::LineWrap::WORD,
1734 DevelText::EllipsisPosition::MIDDLE,
1743 "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
1744 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1746 DevelText::LineWrap::CHARACTER,
1747 DevelText::EllipsisPosition::MIDDLE,
1756 "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
1757 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1759 DevelText::LineWrap::HYPHENATION,
1760 DevelText::EllipsisPosition::MIDDLE,
1769 "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL MIDDLE",
1770 "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1772 DevelText::LineWrap::MIXED,
1773 DevelText::EllipsisPosition::MIDDLE,
1782 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR END",
1783 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1785 DevelText::LineWrap::WORD,
1786 DevelText::EllipsisPosition::END,
1795 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR START",
1796 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1798 DevelText::LineWrap::WORD,
1799 DevelText::EllipsisPosition::START,
1808 "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1809 "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1811 DevelText::LineWrap::WORD,
1812 DevelText::EllipsisPosition::MIDDLE,
1821 const unsigned int numberOfTests = 33u;
1823 for( unsigned int index = 0u; index < numberOfTests; ++index )
1825 ToolkitTestApplication application;
1826 if( !ElideTestTextView( data[index] ) )
1828 tet_result(TET_FAIL);
1832 tet_result(TET_PASS);