}
LayoutOptions options;
- options.reorder = false;
options.align = false;
CreateTextModel( data.text,
data.textArea,
bool isAutoScroll = false;
const bool updated = engine.LayoutText( layoutParameters,
- glyphPositions,
- lines,
layoutSize,
data.ellipsis,
isAutoScroll );
//////////////////////////////////////////////////////////
-struct ReLayoutRightToLeftLinesData
-{
- std::string description;
- std::string text;
- Size textArea;
- unsigned int numberOfFonts;
- FontDescriptionRun* fontDescriptions;
- unsigned int totalNumberOfGlyphs;
- float* positions;
- unsigned int startIndex;
- unsigned int numberOfCharacters;
-};
-
-bool ReLayoutRightToLeftLinesTest( const ReLayoutRightToLeftLinesData& data )
-{
- // Load some fonts.
- TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
- fontClient.SetDpi( 96u, 96u );
-
- char* pathNamePtr = get_current_dir_name();
- const std::string pathName( pathNamePtr );
- free( pathNamePtr );
-
- fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
- fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
- fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
-
- // 1) Create the model.
- ModelPtr textModel;
- MetricsPtr metrics;
- Size layoutSize;
-
- Vector<FontDescriptionRun> fontDescriptionRuns;
- if( 0u != data.numberOfFonts )
- {
- fontDescriptionRuns.Insert( fontDescriptionRuns.End(),
- data.fontDescriptions,
- data.fontDescriptions + data.numberOfFonts );
- }
-
- LayoutOptions options;
- options.reorder = false;
- options.align = false;
- CreateTextModel( data.text,
- data.textArea,
- fontDescriptionRuns,
- options,
- layoutSize,
- textModel,
- metrics,
- false );
-
- LogicalModelPtr logicalModel = textModel->mLogicalModel;
- VisualModelPtr visualModel = textModel->mVisualModel;
-
- // 2) Call the ReLayoutRightToLeftLines() method.
- Layout::Engine engine;
- engine.SetMetrics( metrics );
-
- textModel->mHorizontalAlignment = Text::HorizontalAlignment::BEGIN;
- textModel->mLineWrapMode = LineWrap::WORD;
- textModel->mIgnoreSpacesAfterText = true;
- textModel->mMatchSystemLanguageDirection = false;
- Layout::Parameters layoutParameters( data.textArea,
- textModel );
-
- layoutParameters.numberOfBidirectionalInfoRuns = logicalModel->mBidirectionalLineInfo.Count();
- layoutParameters.lineBidirectionalInfoRunsBuffer = logicalModel->mBidirectionalLineInfo.Begin();
-
- engine.ReLayoutRightToLeftLines( layoutParameters,
- data.startIndex,
- data.numberOfCharacters,
- visualModel->mGlyphPositions );
-
- // 3) Compare the results.
- Vector<Vector2>& glyphPositions = visualModel->mGlyphPositions;
-
- if( data.totalNumberOfGlyphs != visualModel->mGlyphs.Count() )
- {
- std::cout << " Different number of glyphs : " << visualModel->mGlyphs.Count() << ", expected : " << data.totalNumberOfGlyphs << std::endl;
- return false;
- }
-
- for( unsigned int index = 0u; index < data.totalNumberOfGlyphs; ++index )
- {
- const Vector2& position = *( glyphPositions.Begin() + index );
-
- if( fabsf( position.x - *( data.positions + 2u * index ) ) > Math::MACHINE_EPSILON_1000 )
- {
- std::cout << " Different position for glyph " << index << " x : " << position.x << ", expected : " << *( data.positions + 2u * index ) << std::endl;
- return false;
- }
- if( fabsf( position.y - *( data.positions + 2u * index + 1u ) ) > Math::MACHINE_EPSILON_1000 )
- {
- std::cout << " Different position for glyph " << index << " y : " << position.y << ", expected : " << *( data.positions + 2u * index + 1u ) << std::endl;
- return false;
- }
- }
-
- return true;
-}
-
-//////////////////////////////////////////////////////////
-
struct AlignData
{
std::string description;
// UtcDaliTextLayoutMultilineText03
// UtcDaliTextLayoutMultilineText04
// UtcDaliTextLayoutMultilineText05
+// UtcDaliTextLayoutMultilineText06
// UtcDaliTextUpdateLayout01
// UtcDaliTextUpdateLayout02
// UtcDaliTextUpdateLayout03
Size layoutSize(78.f, 114.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -2.f, 32.f, -12.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f,
+ 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
+ 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 28 .. 37
+ 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 38 .. 49
+ 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, // 50 .. 54
};
struct LineRun line0 =
{
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 28u, 10u },
{ 28u, 10u },
- 65.f,
+ 64.f,
15.f,
-4.f,
4.f,
END_TEST;
}
+int UtcDaliTextLayoutMultilineText06(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLayoutMultilineText06");
+
+ const std::string fontFamily( "TizenSansHebrew" );
+
+ // Set a known font description
+ FontDescriptionRun fontDescriptionRun;
+ fontDescriptionRun.characterRun.characterIndex = 0u;
+ fontDescriptionRun.characterRun.numberOfCharacters = 10u;
+ fontDescriptionRun.familyLength = fontFamily.size();
+ fontDescriptionRun.familyName = new char[fontDescriptionRun.familyLength];
+ memcpy( fontDescriptionRun.familyName, fontFamily.c_str(), fontDescriptionRun.familyLength );
+ fontDescriptionRun.familyDefined = true;
+ fontDescriptionRun.weightDefined = false;
+ fontDescriptionRun.widthDefined = false;
+ fontDescriptionRun.slantDefined = false;
+ fontDescriptionRun.sizeDefined = false;
+
+ Vector<FontDescriptionRun> fontDescriptionRuns;
+ fontDescriptionRuns.PushBack( fontDescriptionRun );
+
+ Size textArea(64.f, 100.f);
+ Size layoutSize(31.f, 38.f);
+ float positions[] =
+ {
+ 26.f, -13.f, 17.f, -10.f, 8.f, -10.f, 4.f, -10.f, 0.f, -0.f,
+ 22.f, -10.f, 17.f, -10.f, 12.f, -10.f, 4.f, -10.f, 0.f, -10.f
+ };
+ struct LineRun line0 =
+ {
+ { 0u, 5u },
+ { 0u, 5u },
+ 30.f,
+ 15.f,
+ -4.f,
+ 4.f,
+ 0.f,
+ 0.f,
+ true,
+ false
+ };
+ struct LineRun line1 =
+ {
+ { 5u, 5u },
+ { 5u, 5u },
+ 31.f,
+ 15.f,
+ -4.f,
+ 0.f,
+ 0.f,
+ 0.f,
+ true,
+ false
+ };
+ Vector<LineRun> lines;
+ lines.PushBack( line0 );
+ lines.PushBack( line1 );
+
+ LayoutTextData data =
+ {
+ "Layout right to left text that doesn't fit in the text area after reordering.",
+ "לכאן שנורו", // If this text is laid-out ltr the width is 64. When reordered, the length is 66. This might cause alignment issues.
+ textArea,
+ 1u,
+ fontDescriptionRuns.Begin(),
+ layoutSize,
+ 10u,
+ positions,
+ 2u,
+ lines.Begin(),
+ Layout::Engine::MULTI_LINE_BOX,
+ 0u,
+ 10u,
+ false,
+ true
+ };
+
+ if( !LayoutTextTest( data ) )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ tet_result(TET_PASS);
+ END_TEST;
+}
+
+int UtcDaliTextLayoutMultilineText07(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLayoutMultilineText07");
+
+ const std::string fontFamily( "TizenSansHebrew" );
+
+ // Set a known font description
+ FontDescriptionRun fontDescriptionRun;
+ fontDescriptionRun.characterRun.characterIndex = 0u;
+ fontDescriptionRun.characterRun.numberOfCharacters = 9u;
+ fontDescriptionRun.familyLength = fontFamily.size();
+ fontDescriptionRun.familyName = new char[fontDescriptionRun.familyLength];
+ memcpy( fontDescriptionRun.familyName, fontFamily.c_str(), fontDescriptionRun.familyLength );
+ fontDescriptionRun.familyDefined = true;
+ fontDescriptionRun.weightDefined = false;
+ fontDescriptionRun.widthDefined = false;
+ fontDescriptionRun.slantDefined = false;
+ fontDescriptionRun.sizeDefined = false;
+
+ Vector<FontDescriptionRun> fontDescriptionRuns;
+ fontDescriptionRuns.PushBack( fontDescriptionRun );
+
+ Size textArea(26.f, 100.f);
+ Size layoutSize(21.f, 57.f);
+ float positions[] =
+ {
+ 10.f, -10.f, 5.f, -10.f, 0.f, -10.f,
+ 11.f, -10.f, 7.f, -10.f, 0.f, -13.f,
+ 13.f, -10.f, 4.f, -10.f, 0.f, -10.f
+ };
+ struct LineRun line0 =
+ {
+ { 0u, 3u },
+ { 0u, 3u },
+ 19.f,
+ 15.f,
+ -4.f,
+ 0.f,
+ 0.f,
+ 0.f,
+ true,
+ false
+ };
+ struct LineRun line1 =
+ {
+ { 3u, 3u },
+ { 3u, 3u },
+ 18.f,
+ 15.f,
+ -4.f,
+ 0.f,
+ 0.f,
+ 0.f,
+ true,
+ false
+ };
+ struct LineRun line2 =
+ {
+ { 6u, 3u },
+ { 6u, 3u },
+ 21.f,
+ 15.f,
+ -4.f,
+ 0.f,
+ 0.f,
+ 0.f,
+ true,
+ false
+ };
+ Vector<LineRun> lines;
+ lines.PushBack( line0 );
+ lines.PushBack( line1 );
+ lines.PushBack( line2 );
+
+ LayoutTextData data =
+ {
+ "Layout a single word of right to left text that doesn't fit in one single line. When layouting ltr a piece of word fits in the line but it doesn't after reordering.",
+ "שנורולכאן", // If a piece of this text is laid-out ltr the width is 26. When reordered, the length is 27. This might cause alignment issues.
+ textArea,
+ 1u,
+ fontDescriptionRuns.Begin(),
+ layoutSize,
+ 9u,
+ positions,
+ 3u,
+ lines.Begin(),
+ Layout::Engine::MULTI_LINE_BOX,
+ 0u,
+ 9u,
+ false,
+ true
+ };
+
+ if( !LayoutTextTest( data ) )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ tet_result(TET_PASS);
+ END_TEST;
+}
+
int UtcDaliTextUpdateLayout01(void)
{
ToolkitTestApplication application;
fontDescriptionRuns.PushBack( fontDescriptionRun16 );
fontDescriptionRuns.PushBack( fontDescriptionRun17 );
Size textArea(100.f, 300.f);
- Size layoutSize(92.f, 361.f);
+ Size layoutSize(90.f, 361.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -2.f, 32.f, -12.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 67.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
- 0.f, -9.f, 11.f, -9.f, 21.f, -9.f, 27.f, -13.f, 30.f, -13.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f, 42.f, -12.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -2.f, 32.f, -12.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
+ 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
+ 87.f, -8.f, 82.f, -6.f, 75.f, -8.f, 72.f, -7.f, 71.f, -11.f, 67.f, -0.f, 63.f, -7.f, 62.f, -11.f, 57.f, -11.f, 51.f, -8.f, 50.f, -11.f, 45.f, -11.f, 40.f, -8.f, 37.f, -0.f, 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 0.f, -0.f, // 28 .. 47
+ 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 35.f, -0.f, 25.f, -10.f, 17.f, -13.f, 12.f, -10.f, 4.f, -10.f, 0.f, -0.f, // 48 .. 58
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
+ 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
+ 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 74 .. 85
+ 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
+ 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f, // 92 .. 103
+ 81.f, -8.f, 76.f, -6.f, 69.f, -8.f, 66.f, -7.f, 65.f, -11.f, 61.f, -0.f, 57.f, -7.f, 56.f, -11.f, 51.f, -11.f, 45.f, -8.f, 44.f, -11.f, 39.f, -11.f, 34.f, -8.f, 31.f, -0.f, 21.f, -10.f, 13.f, -13.f, 8.f, -10.f, 0.f, -10.f, 88.f, -0.f, // 104 .. 122
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -0.f, // 123 .. 127
+ 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 128 .. 139
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 140 .. 149
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 150 .. 155
+ 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
+ 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 166 .. 177
+ 47.f, -8.f, 42.f, -6.f, 35.f, -8.f, 32.f, -7.f, 31.f, -11.f, 27.f, -0.f, 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 11.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
};
struct LineRun line01 =
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 28u, 20u },
{ 28u, 20u },
- 92.f,
+ 90.f,
15.f,
-4.f,
4.f,
{
{ 48u, 11u },
{ 48u, 11u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 59u, 5u },
{ 59u, 5u },
- 29.f,
+ 28.f,
15.f,
-4.f,
0.f,
{
{ 64u, 10u },
{ 64u, 10u },
- 65.f,
+ 64.f,
15.f,
-4.f,
4.f,
{
{ 104u, 19u },
{ 104u, 19u },
- 90.f,
+ 88.f,
15.f,
-4.f,
4.f,
{
{ 123u, 5u },
{ 123u, 5u },
- 29.f,
+ 28.f,
15.f,
-4.f,
0.f,
{
{ 140u, 10u },
{ 140u, 10u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 156u, 10u },
{ 156u, 10u },
- 65.f,
+ 64.f,
15.f,
-4.f,
4.f,
{
{ 178u, 14u },
{ 178u, 14u },
- 56.f,
+ 54.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun16 );
fontDescriptionRuns.PushBack( fontDescriptionRun17 );
Size textArea(100.f, 300.f);
- Size layoutSize(92.f, 361.f);
+ Size layoutSize(90.f, 361.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -2.f, 32.f, -12.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 67.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
- 0.f, -9.f, 11.f, -9.f, 21.f, -9.f, 27.f, -13.f, 30.f, -13.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f, 42.f, -12.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -2.f, 32.f, -12.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
+ 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
+ 87.f, -8.f, 82.f, -6.f, 75.f, -8.f, 72.f, -7.f, 71.f, -11.f, 67.f, -0.f, 63.f, -7.f, 62.f, -11.f, 57.f, -11.f, 51.f, -8.f, 50.f, -11.f, 45.f, -11.f, 40.f, -8.f, 37.f, -0.f, 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 0.f, -0.f, // 28 .. 47
+ 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 35.f, -0.f, 25.f, -10.f, 17.f, -13.f, 12.f, -10.f, 4.f, -10.f, 0.f, -0.f, // 48 .. 58
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
+ 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
+ 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 74 .. 85
+ 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
+ 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f, // 92 .. 103
+ 81.f, -8.f, 76.f, -6.f, 69.f, -8.f, 66.f, -7.f, 65.f, -11.f, 61.f, -0.f, 57.f, -7.f, 56.f, -11.f, 51.f, -11.f, 45.f, -8.f, 44.f, -11.f, 39.f, -11.f, 34.f, -8.f, 31.f, -0.f, 21.f, -10.f, 13.f, -13.f, 8.f, -10.f, 0.f, -10.f, 88.f, -0.f, // 104 .. 122
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -0.f, // 123 .. 127
+ 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 128 .. 139
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 140 .. 149
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 150 .. 155
+ 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
+ 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 166 .. 177
+ 47.f, -8.f, 42.f, -6.f, 35.f, -8.f, 32.f, -7.f, 31.f, -11.f, 27.f, -0.f, 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 11.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
};
struct LineRun line01 =
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 28u, 20u },
{ 28u, 20u },
- 92.f,
+ 90.f,
15.f,
-4.f,
4.f,
{
{ 48u, 11u },
{ 48u, 11u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 59u, 5u },
{ 59u, 5u },
- 29.f,
+ 28.f,
15.f,
-4.f,
0.f,
{
{ 64u, 10u },
{ 64u, 10u },
- 65.f,
+ 64.f,
15.f,
-4.f,
4.f,
{
{ 104u, 19u },
{ 104u, 19u },
- 90.f,
+ 88.f,
15.f,
-4.f,
4.f,
{
{ 123u, 5u },
{ 123u, 5u },
- 29.f,
+ 28.f,
15.f,
-4.f,
0.f,
{
{ 140u, 10u },
{ 140u, 10u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 156u, 10u },
{ 156u, 10u },
- 65.f,
+ 64.f,
15.f,
-4.f,
4.f,
{
{ 178u, 14u },
{ 178u, 14u },
- 56.f,
+ 54.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun16 );
fontDescriptionRuns.PushBack( fontDescriptionRun17 );
Size textArea(100.f, 300.f);
- Size layoutSize(92.f, 361.f);
+ Size layoutSize(90.f, 361.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -2.f, 32.f, -12.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 67.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
- 0.f, -9.f, 11.f, -9.f, 21.f, -9.f, 27.f, -13.f, 30.f, -13.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f, 42.f, -12.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -2.f, 32.f, -12.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f,
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
+ 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
+ 87.f, -8.f, 82.f, -6.f, 75.f, -8.f, 72.f, -7.f, 71.f, -11.f, 67.f, -0.f, 63.f, -7.f, 62.f, -11.f, 57.f, -11.f, 51.f, -8.f, 50.f, -11.f, 45.f, -11.f, 40.f, -8.f, 37.f, -0.f, 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 0.f, -0.f, // 28 .. 47
+ 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 35.f, -0.f, 25.f, -10.f, 17.f, -13.f, 12.f, -10.f, 4.f, -10.f, 0.f, -0.f, // 48 .. 58
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
+ 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
+ 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 74 .. 85
+ 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
+ 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f, // 92 .. 103
+ 81.f, -8.f, 76.f, -6.f, 69.f, -8.f, 66.f, -7.f, 65.f, -11.f, 61.f, -0.f, 57.f, -7.f, 56.f, -11.f, 51.f, -11.f, 45.f, -8.f, 44.f, -11.f, 39.f, -11.f, 34.f, -8.f, 31.f, -0.f, 21.f, -10.f, 13.f, -13.f, 8.f, -10.f, 0.f, -10.f, 88.f, -0.f, // 104 .. 122
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -0.f, // 123 .. 127
+ 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 128 .. 139
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 140 .. 149
+ 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 150 .. 155
+ 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
+ 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 166 .. 177
+ 47.f, -8.f, 42.f, -6.f, 35.f, -8.f, 32.f, -7.f, 31.f, -11.f, 27.f, -0.f, 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 11.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
};
struct LineRun line01 =
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 28u, 20u },
{ 28u, 20u },
- 92.f,
+ 90.f,
15.f,
-4.f,
4.f,
{
{ 48u, 11u },
{ 48u, 11u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 59u, 5u },
{ 59u, 5u },
- 29.f,
+ 28.f,
15.f,
-4.f,
0.f,
{
{ 64u, 10u },
{ 64u, 10u },
- 65.f,
+ 64.f,
15.f,
-4.f,
4.f,
{
{ 104u, 19u },
{ 104u, 19u },
- 90.f,
+ 88.f,
15.f,
-4.f,
4.f,
{
{ 123u, 5u },
{ 123u, 5u },
- 29.f,
+ 28.f,
15.f,
-4.f,
0.f,
{
{ 140u, 10u },
{ 140u, 10u },
- 75.f,
+ 74.f,
15.f,
-4.f,
4.f,
{
{ 156u, 10u },
{ 156u, 10u },
- 65.f,
+ 64.f,
15.f,
-4.f,
4.f,
{
{ 178u, 14u },
{ 178u, 14u },
- 56.f,
+ 54.f,
15.f,
-4.f,
0.f,
{
{ 0u, 17u },
{ 0u, 17u },
- 99.f,
+ 100.f,
15.f,
-4.f,
0.f,
float positions[] =
{
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f, 68.f, -8.f, 75.f, -6.f, 80.f, -8.f, 86.f, -7.f, 91.f, -11.f, 93.f, -0.f,
+ 91.f, -10.f, 83.f, -13.f, 78.f, -10.f, 70.f, -10.f, 65.f, -0.f, 57.f, -10.f, 52.f, -10.f, 45.f, -13.f, 36.f, -10.f, 31.f, -0.f, 24.f, -8.f, 19.f, -6.f, 12.f, -8.f, 9.f, -7.f, 8.f, -11.f, 4.f, -0.f,
};
Size textArea( 100.f, 50.f );
{
{ 0u, 16u },
{ 0u, 16u },
- 94.f,
+ 92.f,
15.f,
-4.f,
3.f,
{
{ 16u, 18u },
{ 16u, 18u },
- 97.f,
+ 95.f,
15.f,
-4.f,
4.f,
float positions[] =
{
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f, 68.f, -8.f, 75.f, -6.f, 80.f, -8.f, 86.f, -7.f, 91.f, -11.f, 93.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f, 32.f, -10.f, 43.f, -13.f, 50.f, -10.f, 55.f, -10.f, 63.f, -0.f, 68.f, -10.f, 76.f, -10.f, 81.f, -13.f, 89.f, -10.f, 97.f, -0.f,
+ 86.f, -10.f, 78.f, -13.f, 73.f, -10.f, 65.f, -10.f, 60.f, -0.f, 52.f, -10.f, 47.f, -10.f, 40.f, -13.f, 31.f, -10.f, 26.f, -0.f, 19.f, -8.f, 14.f, -6.f, 7.f, -8.f, 4.f, -7.f, 3.f, -11.f, 0.f, -0.f,
+ 95.f, -7.f, 94.f, -11.f, 89.f, -11.f, 83.f, -8.f, 82.f, -11.f, 77.f, -11.f, 72.f, -8.f, 69.f, -0.f, 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f,
};
Size textArea( 100.f, 50.f );
LayoutTextData data =
{
- "Layout single-line RTL text with ellipsis.",
+ "Layout multi-line RTL text with ellipsis.",
"שלום עולם مرحبا بالعالم שלום עולם مرحبا بالعالم שלום עולם مرحبا بالعالم.",
textArea,
6u,
END_TEST;
}
-int UtcDaliTextReorderLayout01(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliTextReorderLayout01");
-
- // Reorder lines. No right to left characters.
-
- const std::string fontLatin( "TizenSans" );
-
- // Set a known font description
- FontDescriptionRun fontDescriptionRun01;
- fontDescriptionRun01.characterRun.characterIndex = 0u;
- fontDescriptionRun01.characterRun.numberOfCharacters = 11u;
- fontDescriptionRun01.familyLength = fontLatin.size();
- fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength];
- memcpy( fontDescriptionRun01.familyName, fontLatin.c_str(), fontDescriptionRun01.familyLength );
- fontDescriptionRun01.familyDefined = true;
- fontDescriptionRun01.weightDefined = false;
- fontDescriptionRun01.widthDefined = false;
- fontDescriptionRun01.slantDefined = false;
- fontDescriptionRun01.sizeDefined = false;
-
- Vector<FontDescriptionRun> fontDescriptionRuns;
- fontDescriptionRuns.PushBack( fontDescriptionRun01 );
-
- float positions[] =
- {
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f,
- };
-
- Size textArea( 100.f, 300.f );
-
- ReLayoutRightToLeftLinesData data =
- {
- "Text with no right to left text.",
- "Hello world",
- textArea,
- 1u,
- fontDescriptionRuns.Begin(),
- 11u,
- positions,
- 0u,
- 11u
- };
-
- if( !ReLayoutRightToLeftLinesTest( data ) )
- {
- tet_result(TET_FAIL);
- }
-
- tet_result(TET_PASS);
- END_TEST;
-}
-
-int UtcDaliTextReorderLayout02(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliTextReorderLayout02");
-
- // Reorder lines of the first paragraph.
-
- const std::string fontHebrew( "TizenSansHebrew" );
- const std::string fontArabic( "TizenSansArabic" );
-
- // Set a known font description
- FontDescriptionRun fontDescriptionRun01;
- fontDescriptionRun01.characterRun.characterIndex = 0u;
- fontDescriptionRun01.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun01.familyLength = fontHebrew.size();
- fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength];
- memcpy( fontDescriptionRun01.familyName, fontHebrew.c_str(), fontDescriptionRun01.familyLength );
- fontDescriptionRun01.familyDefined = true;
- fontDescriptionRun01.weightDefined = false;
- fontDescriptionRun01.widthDefined = false;
- fontDescriptionRun01.slantDefined = false;
- fontDescriptionRun01.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun02;
- fontDescriptionRun02.characterRun.characterIndex = 10u;
- fontDescriptionRun02.characterRun.numberOfCharacters = 14u;
- fontDescriptionRun02.familyLength = fontArabic.size();
- fontDescriptionRun02.familyName = new char[fontDescriptionRun02.familyLength];
- memcpy( fontDescriptionRun02.familyName, fontArabic.c_str(), fontDescriptionRun02.familyLength );
- fontDescriptionRun02.familyDefined = true;
- fontDescriptionRun02.weightDefined = false;
- fontDescriptionRun02.widthDefined = false;
- fontDescriptionRun02.slantDefined = false;
- fontDescriptionRun02.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun03;
- fontDescriptionRun03.characterRun.characterIndex = 24u;
- fontDescriptionRun03.characterRun.numberOfCharacters = 14u;
- fontDescriptionRun03.familyLength = fontArabic.size();
- fontDescriptionRun03.familyName = new char[fontDescriptionRun03.familyLength];
- memcpy( fontDescriptionRun03.familyName, fontArabic.c_str(), fontDescriptionRun03.familyLength );
- fontDescriptionRun03.familyDefined = true;
- fontDescriptionRun03.weightDefined = false;
- fontDescriptionRun03.widthDefined = false;
- fontDescriptionRun03.slantDefined = false;
- fontDescriptionRun03.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun04;
- fontDescriptionRun04.characterRun.characterIndex = 38u;
- fontDescriptionRun04.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun04.familyLength = fontHebrew.size();
- fontDescriptionRun04.familyName = new char[fontDescriptionRun04.familyLength];
- memcpy( fontDescriptionRun04.familyName, fontHebrew.c_str(), fontDescriptionRun04.familyLength );
- fontDescriptionRun04.familyDefined = true;
- fontDescriptionRun04.weightDefined = false;
- fontDescriptionRun04.widthDefined = false;
- fontDescriptionRun04.slantDefined = false;
- fontDescriptionRun04.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun05;
- fontDescriptionRun05.characterRun.characterIndex = 48u;
- fontDescriptionRun05.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun05.familyLength = fontHebrew.size();
- fontDescriptionRun05.familyName = new char[fontDescriptionRun05.familyLength];
- memcpy( fontDescriptionRun05.familyName, fontHebrew.c_str(), fontDescriptionRun05.familyLength );
- fontDescriptionRun05.familyDefined = true;
- fontDescriptionRun05.weightDefined = false;
- fontDescriptionRun05.widthDefined = false;
- fontDescriptionRun05.slantDefined = false;
- fontDescriptionRun05.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun06;
- fontDescriptionRun06.characterRun.characterIndex = 58u;
- fontDescriptionRun06.characterRun.numberOfCharacters = 15u;
- fontDescriptionRun06.familyLength = fontArabic.size();
- fontDescriptionRun06.familyName = new char[fontDescriptionRun06.familyLength];
- memcpy( fontDescriptionRun06.familyName, fontArabic.c_str(), fontDescriptionRun06.familyLength );
- fontDescriptionRun06.familyDefined = true;
- fontDescriptionRun06.weightDefined = false;
- fontDescriptionRun06.widthDefined = false;
- fontDescriptionRun06.slantDefined = false;
- fontDescriptionRun06.sizeDefined = false;
-
- Vector<FontDescriptionRun> fontDescriptionRuns;
- fontDescriptionRuns.PushBack( fontDescriptionRun01 );
- fontDescriptionRuns.PushBack( fontDescriptionRun02 );
- fontDescriptionRuns.PushBack( fontDescriptionRun03 );
- fontDescriptionRuns.PushBack( fontDescriptionRun04 );
- fontDescriptionRuns.PushBack( fontDescriptionRun05 );
- fontDescriptionRuns.PushBack( fontDescriptionRun06 );
-
- float positions[] =
- {
- 87.f, -10.f, 79.f, -13.f, 74.f, -10.f, 66.f, -10.f, 61.f, -0.f, 53.f, -10.f, 48.f, -10.f, 41.f, -13.f, 32.f, -10.f, 27.f, -0.f, 20.f, -8.f, 15.f, -6.f, 8.f, -8.f, 5.f, -7.f, 4.f, -11.f, 0.f, -0.f,
- 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 11.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f, 68.f, -8.f, 75.f, -6.f, 80.f, -8.f, 86.f, -7.f, 91.f, -11.f, 93.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 30.f, -2.f,
- };
-
- Size textArea( 100.f, 300.f );
-
- ReLayoutRightToLeftLinesData data =
- {
- "Paragraphs with right to left text.",
- "שלום עולם مرحبا بالعالم\n"
- "مرحبا بالعالم שלום עולם\n"
- "שלום עולם مرحبا بالعالم.",
- textArea,
- 6u,
- fontDescriptionRuns.Begin(),
- 72u,
- positions,
- 0u,
- 24u
- };
-
- if( !ReLayoutRightToLeftLinesTest( data ) )
- {
- tet_result(TET_FAIL);
- }
-
- tet_result(TET_PASS);
- END_TEST;
-}
-
-int UtcDaliTextReorderLayout03(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliTextReorderLayout03");
-
- // Reorder lines of the mid paragraph.
-
- const std::string fontHebrew( "TizenSansHebrew" );
- const std::string fontArabic( "TizenSansArabic" );
-
- // Set a known font description
- FontDescriptionRun fontDescriptionRun01;
- fontDescriptionRun01.characterRun.characterIndex = 0u;
- fontDescriptionRun01.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun01.familyLength = fontHebrew.size();
- fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength];
- memcpy( fontDescriptionRun01.familyName, fontHebrew.c_str(), fontDescriptionRun01.familyLength );
- fontDescriptionRun01.familyDefined = true;
- fontDescriptionRun01.weightDefined = false;
- fontDescriptionRun01.widthDefined = false;
- fontDescriptionRun01.slantDefined = false;
- fontDescriptionRun01.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun02;
- fontDescriptionRun02.characterRun.characterIndex = 10u;
- fontDescriptionRun02.characterRun.numberOfCharacters = 14u;
- fontDescriptionRun02.familyLength = fontArabic.size();
- fontDescriptionRun02.familyName = new char[fontDescriptionRun02.familyLength];
- memcpy( fontDescriptionRun02.familyName, fontArabic.c_str(), fontDescriptionRun02.familyLength );
- fontDescriptionRun02.familyDefined = true;
- fontDescriptionRun02.weightDefined = false;
- fontDescriptionRun02.widthDefined = false;
- fontDescriptionRun02.slantDefined = false;
- fontDescriptionRun02.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun03;
- fontDescriptionRun03.characterRun.characterIndex = 24u;
- fontDescriptionRun03.characterRun.numberOfCharacters = 14u;
- fontDescriptionRun03.familyLength = fontArabic.size();
- fontDescriptionRun03.familyName = new char[fontDescriptionRun03.familyLength];
- memcpy( fontDescriptionRun03.familyName, fontArabic.c_str(), fontDescriptionRun03.familyLength );
- fontDescriptionRun03.familyDefined = true;
- fontDescriptionRun03.weightDefined = false;
- fontDescriptionRun03.widthDefined = false;
- fontDescriptionRun03.slantDefined = false;
- fontDescriptionRun03.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun04;
- fontDescriptionRun04.characterRun.characterIndex = 38u;
- fontDescriptionRun04.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun04.familyLength = fontHebrew.size();
- fontDescriptionRun04.familyName = new char[fontDescriptionRun04.familyLength];
- memcpy( fontDescriptionRun04.familyName, fontHebrew.c_str(), fontDescriptionRun04.familyLength );
- fontDescriptionRun04.familyDefined = true;
- fontDescriptionRun04.weightDefined = false;
- fontDescriptionRun04.widthDefined = false;
- fontDescriptionRun04.slantDefined = false;
- fontDescriptionRun04.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun05;
- fontDescriptionRun05.characterRun.characterIndex = 48u;
- fontDescriptionRun05.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun05.familyLength = fontHebrew.size();
- fontDescriptionRun05.familyName = new char[fontDescriptionRun05.familyLength];
- memcpy( fontDescriptionRun05.familyName, fontHebrew.c_str(), fontDescriptionRun05.familyLength );
- fontDescriptionRun05.familyDefined = true;
- fontDescriptionRun05.weightDefined = false;
- fontDescriptionRun05.widthDefined = false;
- fontDescriptionRun05.slantDefined = false;
- fontDescriptionRun05.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun06;
- fontDescriptionRun06.characterRun.characterIndex = 58u;
- fontDescriptionRun06.characterRun.numberOfCharacters = 15u;
- fontDescriptionRun06.familyLength = fontArabic.size();
- fontDescriptionRun06.familyName = new char[fontDescriptionRun06.familyLength];
- memcpy( fontDescriptionRun06.familyName, fontArabic.c_str(), fontDescriptionRun06.familyLength );
- fontDescriptionRun06.familyDefined = true;
- fontDescriptionRun06.weightDefined = false;
- fontDescriptionRun06.widthDefined = false;
- fontDescriptionRun06.slantDefined = false;
- fontDescriptionRun06.sizeDefined = false;
-
- Vector<FontDescriptionRun> fontDescriptionRuns;
- fontDescriptionRuns.PushBack( fontDescriptionRun01 );
- fontDescriptionRuns.PushBack( fontDescriptionRun02 );
- fontDescriptionRuns.PushBack( fontDescriptionRun03 );
- fontDescriptionRuns.PushBack( fontDescriptionRun04 );
- fontDescriptionRuns.PushBack( fontDescriptionRun05 );
- fontDescriptionRuns.PushBack( fontDescriptionRun06 );
-
- float positions[] =
- {
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f, 68.f, -8.f, 75.f, -6.f, 80.f, -8.f, 86.f, -7.f, 91.f, -11.f, 93.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f,
- 86.f, -8.f, 81.f, -6.f, 74.f, -8.f, 71.f, -7.f, 70.f, -11.f, 66.f, -0.f, 62.f, -7.f, 61.f, -11.f, 56.f, -11.f, 50.f, -8.f, 49.f, -11.f, 44.f, -11.f, 39.f, -8.f, 36.f, -0.f, 26.f, -10.f, 18.f, -13.f, 13.f, -10.f, 5.f, -10.f, 0.f, -0.f,
- 22.f, -10.f, 17.f, -10.f, 10.f, -13.f, 1.f, -10.f, 0.f, -0.f,
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f, 68.f, -8.f, 75.f, -6.f, 80.f, -8.f, 86.f, -7.f, 91.f, -11.f, 93.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 30.f, -2.f,
- };
-
- Size textArea( 100.f, 300.f );
-
- ReLayoutRightToLeftLinesData data =
- {
- "Paragraphs with right to left text.",
- "שלום עולם مرحبا بالعالم\n"
- "مرحبا بالعالم שלום עולם\n"
- "שלום עולם مرحبا بالعالم.",
- textArea,
- 6u,
- fontDescriptionRuns.Begin(),
- 72u,
- positions,
- 24u,
- 24u
- };
-
- if( !ReLayoutRightToLeftLinesTest( data ) )
- {
- tet_result(TET_FAIL);
- }
-
- tet_result(TET_PASS);
- END_TEST;
-}
-
-int UtcDaliTextReorderLayout04(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliTextReorderLayout04");
-
- // Reorder lines of the last paragraph.
-
- const std::string fontHebrew( "TizenSansHebrew" );
- const std::string fontArabic( "TizenSansArabic" );
-
- // Set a known font description
- FontDescriptionRun fontDescriptionRun01;
- fontDescriptionRun01.characterRun.characterIndex = 0u;
- fontDescriptionRun01.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun01.familyLength = fontHebrew.size();
- fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength];
- memcpy( fontDescriptionRun01.familyName, fontHebrew.c_str(), fontDescriptionRun01.familyLength );
- fontDescriptionRun01.familyDefined = true;
- fontDescriptionRun01.weightDefined = false;
- fontDescriptionRun01.widthDefined = false;
- fontDescriptionRun01.slantDefined = false;
- fontDescriptionRun01.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun02;
- fontDescriptionRun02.characterRun.characterIndex = 10u;
- fontDescriptionRun02.characterRun.numberOfCharacters = 14u;
- fontDescriptionRun02.familyLength = fontArabic.size();
- fontDescriptionRun02.familyName = new char[fontDescriptionRun02.familyLength];
- memcpy( fontDescriptionRun02.familyName, fontArabic.c_str(), fontDescriptionRun02.familyLength );
- fontDescriptionRun02.familyDefined = true;
- fontDescriptionRun02.weightDefined = false;
- fontDescriptionRun02.widthDefined = false;
- fontDescriptionRun02.slantDefined = false;
- fontDescriptionRun02.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun03;
- fontDescriptionRun03.characterRun.characterIndex = 24u;
- fontDescriptionRun03.characterRun.numberOfCharacters = 14u;
- fontDescriptionRun03.familyLength = fontArabic.size();
- fontDescriptionRun03.familyName = new char[fontDescriptionRun03.familyLength];
- memcpy( fontDescriptionRun03.familyName, fontArabic.c_str(), fontDescriptionRun03.familyLength );
- fontDescriptionRun03.familyDefined = true;
- fontDescriptionRun03.weightDefined = false;
- fontDescriptionRun03.widthDefined = false;
- fontDescriptionRun03.slantDefined = false;
- fontDescriptionRun03.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun04;
- fontDescriptionRun04.characterRun.characterIndex = 38u;
- fontDescriptionRun04.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun04.familyLength = fontHebrew.size();
- fontDescriptionRun04.familyName = new char[fontDescriptionRun04.familyLength];
- memcpy( fontDescriptionRun04.familyName, fontHebrew.c_str(), fontDescriptionRun04.familyLength );
- fontDescriptionRun04.familyDefined = true;
- fontDescriptionRun04.weightDefined = false;
- fontDescriptionRun04.widthDefined = false;
- fontDescriptionRun04.slantDefined = false;
- fontDescriptionRun04.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun05;
- fontDescriptionRun05.characterRun.characterIndex = 48u;
- fontDescriptionRun05.characterRun.numberOfCharacters = 10u;
- fontDescriptionRun05.familyLength = fontHebrew.size();
- fontDescriptionRun05.familyName = new char[fontDescriptionRun05.familyLength];
- memcpy( fontDescriptionRun05.familyName, fontHebrew.c_str(), fontDescriptionRun05.familyLength );
- fontDescriptionRun05.familyDefined = true;
- fontDescriptionRun05.weightDefined = false;
- fontDescriptionRun05.widthDefined = false;
- fontDescriptionRun05.slantDefined = false;
- fontDescriptionRun05.sizeDefined = false;
-
- FontDescriptionRun fontDescriptionRun06;
- fontDescriptionRun06.characterRun.characterIndex = 58u;
- fontDescriptionRun06.characterRun.numberOfCharacters = 15u;
- fontDescriptionRun06.familyLength = fontArabic.size();
- fontDescriptionRun06.familyName = new char[fontDescriptionRun06.familyLength];
- memcpy( fontDescriptionRun06.familyName, fontArabic.c_str(), fontDescriptionRun06.familyLength );
- fontDescriptionRun06.familyDefined = true;
- fontDescriptionRun06.weightDefined = false;
- fontDescriptionRun06.widthDefined = false;
- fontDescriptionRun06.slantDefined = false;
- fontDescriptionRun06.sizeDefined = false;
-
- Vector<FontDescriptionRun> fontDescriptionRuns;
- fontDescriptionRuns.PushBack( fontDescriptionRun01 );
- fontDescriptionRuns.PushBack( fontDescriptionRun02 );
- fontDescriptionRuns.PushBack( fontDescriptionRun03 );
- fontDescriptionRuns.PushBack( fontDescriptionRun04 );
- fontDescriptionRuns.PushBack( fontDescriptionRun05 );
- fontDescriptionRuns.PushBack( fontDescriptionRun06 );
-
- float positions[] =
- {
- 0.f, -10.f, 11.f, -13.f, 18.f, -10.f, 23.f, -10.f, 31.f, -0.f, 36.f, -10.f, 44.f, -10.f, 49.f, -13.f, 57.f, -10.f, 65.f, -0.f, 68.f, -8.f, 75.f, -6.f, 80.f, -8.f, 86.f, -7.f, 91.f, -11.f, 93.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
- 0.f, -10.f, 8.f, -10.f, 13.f, -13.f, 21.f, -10.f, 29.f, -0.f,
- 87.f, -10.f, 79.f, -13.f, 74.f, -10.f, 66.f, -10.f, 61.f, -0.f, 53.f, -10.f, 48.f, -10.f, 41.f, -13.f, 32.f, -10.f, 27.f, -0.f, 20.f, -8.f, 15.f, -6.f, 8.f, -8.f, 5.f, -7.f, 4.f, -11.f, 0.f, -0.f,
- 26.f, -7.f, 25.f, -11.f, 20.f, -11.f, 14.f, -8.f, 13.f, -11.f, 8.f, -11.f, 3.f, -8.f, 0.f, -2.f,
- };
-
- Size textArea( 100.f, 300.f );
-
- ReLayoutRightToLeftLinesData data =
- {
- "Paragraphs with right to left text.",
- "שלום עולם مرحبا بالعالم\n"
- "مرحبا بالعالم שלום עולם\n"
- "שלום עולם مرحبا بالعالم.",
- textArea,
- 6u,
- fontDescriptionRuns.Begin(),
- 72u,
- positions,
- 48u,
- 24u
- };
-
- if( !ReLayoutRightToLeftLinesTest( data ) )
- {
- tet_result(TET_FAIL);
- }
-
- tet_result(TET_PASS);
- END_TEST;
-}
-
int UtcDaliTextAlign01(void)
{
ToolkitTestApplication application;
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 0.f, 0.f, 2.f, 61.f, 0.f, 0.f };
+ float positions[] = { 0.f, 0.f, 4.f, 61.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 11.f, 17.f, 0.f, 0.f, 0.f, 0.f };
+ float positions[] = { 11.f, 18.f, 0.f, 0.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 0.f, 0.f, -1.f, 30.f, 0.f, 0.f };
+ float positions[] = { 0.f, 0.f, 0.f, 30.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 22.f, 35.f, 0.f, 0.f, 0.f, 0.f };
+ float positions[] = { 22.f, 36.f, 0.f, 0.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 0.f, 0.f, 0.f, 0.f, 22.f, 42.f };
+ float positions[] = { 0.f, 0.f, 0.f, 0.f, 22.f, 43.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 22.f, 35.f, 2.f, 0.f, 0.f, 0.f };
+ float positions[] = { 22.f, 36.f, 4.f, 0.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
#include <dali/devel-api/text-abstraction/font-client.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/bidirectional-line-info-run.h>
+#include <dali-toolkit/internal/text/bidirectional-support.h>
#include <dali-toolkit/internal/text/cursor-helper-functions.h>
#include <dali-toolkit/internal/text/glyph-metrics-helper.h>
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
struct LineLayout
{
LineLayout()
- : glyphIndex( 0u ),
- characterIndex( 0u ),
- numberOfGlyphs( 0u ),
- numberOfCharacters( 0u ),
- ascender( -MAX_FLOAT ),
- descender( MAX_FLOAT ),
- lineSpacing( 0.f ),
- penX( 0.f ),
- previousAdvance( 0.f ),
- length( 0.f ),
- wsLengthEndOfLine( 0.f )
+ : glyphIndex{ 0u },
+ characterIndex{ 0u },
+ numberOfGlyphs{ 0u },
+ numberOfCharacters{ 0u },
+ ascender{ -MAX_FLOAT },
+ descender{ MAX_FLOAT },
+ lineSpacing{ 0.f },
+ penX{ 0.f },
+ previousAdvance{ 0.f },
+ length{ 0.f },
+ whiteSpaceLengthEndOfLine{ 0.f },
+ direction{ LTR }
{}
~LineLayout()
characterIndex = 0u;
numberOfGlyphs = 0u;
numberOfCharacters = 0u;
- ascender = 0.f;
+ ascender = -MAX_FLOAT;
descender = MAX_FLOAT;
+ direction = LTR;
}
- GlyphIndex glyphIndex; ///< Index of the first glyph to be laid-out.
- CharacterIndex characterIndex; ///< Index of the first character to be laid-out.
- Length numberOfGlyphs; ///< The number of glyph which fit in one line.
- Length numberOfCharacters; ///< The number of characters which fit in one line.
- float ascender; ///< The maximum ascender of all fonts in the line.
- float descender; ///< The minimum descender of all fonts in the line.
- float lineSpacing; ///< The line spacing
- float penX; ///< The origin of the current glyph ( is the start point plus the accumulation of all advances ).
- float previousAdvance; ///< The advance of the previous glyph.
- float length; ///< The current length of the line.
- float wsLengthEndOfLine; ///< The length of the white spaces at the end of the line.
+ GlyphIndex glyphIndex; ///< Index of the first glyph to be laid-out.
+ CharacterIndex characterIndex; ///< Index of the first character to be laid-out.
+ Length numberOfGlyphs; ///< The number of glyph which fit in one line.
+ Length numberOfCharacters; ///< The number of characters which fit in one line.
+ float ascender; ///< The maximum ascender of all fonts in the line.
+ float descender; ///< The minimum descender of all fonts in the line.
+ float lineSpacing; ///< The line spacing
+ float penX; ///< The origin of the current glyph ( is the start point plus the accumulation of all advances ).
+ float previousAdvance; ///< The advance of the previous glyph.
+ float length; ///< The current length of the line.
+ float whiteSpaceLengthEndOfLine; ///< The length of the white spaces at the end of the line.
+ CharacterDirection direction;
+};
+
+struct LayoutBidiParameters
+{
+ void Clear()
+ {
+ paragraphDirection = LTR;
+ bidiParagraphIndex = 0u;
+ bidiLineIndex = 0u;
+ isBidirectional = false;
+ }
+
+ CharacterDirection paragraphDirection = LTR; ///< The paragraph's direction.
+ BidirectionalRunIndex bidiParagraphIndex = 0u; ///< Index to the paragraph's bidi info.
+ BidirectionalLineRunIndex bidiLineIndex = 0u; ///< Index where to insert the next bidi line info.
+ bool isBidirectional = false; ///< Whether the text is bidirectional.
};
struct Engine::Impl
{
Impl()
- : mLayout( Layout::Engine::SINGLE_LINE_BOX ),
- mCursorWidth( 0.f ),
- mDefaultLineSpacing( LINE_SPACING )
+ : mLayout{ Layout::Engine::SINGLE_LINE_BOX },
+ mCursorWidth{ 0.f },
+ mDefaultLineSpacing{ LINE_SPACING }
{
}
lineLayout.previousAdvance = tmpLineLayout.previousAdvance;
lineLayout.length = tmpLineLayout.length;
- lineLayout.wsLengthEndOfLine = tmpLineLayout.wsLengthEndOfLine;
+ lineLayout.whiteSpaceLengthEndOfLine = tmpLineLayout.whiteSpaceLengthEndOfLine;
// Sets the maximum ascender.
lineLayout.ascender = std::max( lineLayout.ascender, tmpLineLayout.ascender );
lineLayout.descender = std::min( lineLayout.descender, tmpLineLayout.descender );
}
+ void LayoutRightToLeft( const Parameters& parameters,
+ const BidirectionalLineInfoRun& bidirectionalLineInfo,
+ float& length,
+ float& whiteSpaceLengthEndOfLine )
+ {
+ const Character* const textBuffer = parameters.textModel->mLogicalModel->mText.Begin();
+ const Length* const charactersPerGlyphBuffer = parameters.textModel->mVisualModel->mCharactersPerGlyph.Begin();
+ const GlyphInfo* const glyphsBuffer = parameters.textModel->mVisualModel->mGlyphs.Begin();
+ const GlyphIndex* const charactersToGlyphsBuffer = parameters.textModel->mVisualModel->mCharactersToGlyph.Begin();
+
+ const float outlineWidth = static_cast<float>( parameters.textModel->GetOutlineWidth() );
+ const GlyphIndex lastGlyphOfParagraphPlusOne = parameters.startGlyphIndex + parameters.numberOfGlyphs;
+
+ CharacterIndex characterLogicalIndex = 0u;
+ CharacterIndex characterVisualIndex = bidirectionalLineInfo.characterRun.characterIndex + *( bidirectionalLineInfo.visualToLogicalMap + characterLogicalIndex );
+
+ if( RTL == bidirectionalLineInfo.direction )
+ {
+ while( TextAbstraction::IsWhiteSpace( *( textBuffer + characterVisualIndex ) ) )
+ {
+ const GlyphInfo& glyphInfo = *( glyphsBuffer + *( charactersToGlyphsBuffer + characterVisualIndex ) );
+
+ whiteSpaceLengthEndOfLine += glyphInfo.advance;
+
+ ++characterLogicalIndex;
+ characterVisualIndex = bidirectionalLineInfo.characterRun.characterIndex + *( bidirectionalLineInfo.visualToLogicalMap + characterLogicalIndex );
+ }
+ }
+
+ const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex );
+
+ // Check whether the first glyph comes from a character that is shaped in multiple glyphs.
+ const Length numberOfGLyphsInGroup = GetNumberOfGlyphsOfGroup( glyphIndex,
+ lastGlyphOfParagraphPlusOne,
+ charactersPerGlyphBuffer );
+
+ GlyphMetrics glyphMetrics;
+ GetGlyphsMetrics( glyphIndex,
+ numberOfGLyphsInGroup,
+ glyphMetrics,
+ glyphsBuffer,
+ mMetrics );
+
+ float penX = -glyphMetrics.xBearing + mCursorWidth + outlineWidth;
+
+ // Traverses the characters of the right to left paragraph.
+ for( ; characterLogicalIndex < bidirectionalLineInfo.characterRun.numberOfCharacters; )
+ {
+ // Convert the character in the logical order into the character in the visual order.
+ const CharacterIndex characterVisualIndex = bidirectionalLineInfo.characterRun.characterIndex + *( bidirectionalLineInfo.visualToLogicalMap + characterLogicalIndex );
+ const bool isWhiteSpace = TextAbstraction::IsWhiteSpace( *( textBuffer + characterVisualIndex ) );
+
+ const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex );
+
+ // Check whether this glyph comes from a character that is shaped in multiple glyphs.
+ const Length numberOfGLyphsInGroup = GetNumberOfGlyphsOfGroup( glyphIndex,
+ lastGlyphOfParagraphPlusOne,
+ charactersPerGlyphBuffer );
+
+ characterLogicalIndex += *( charactersPerGlyphBuffer + glyphIndex + numberOfGLyphsInGroup - 1u );
+
+ GlyphMetrics glyphMetrics;
+ GetGlyphsMetrics( glyphIndex,
+ numberOfGLyphsInGroup,
+ glyphMetrics,
+ glyphsBuffer,
+ mMetrics );
+
+ if( isWhiteSpace )
+ {
+ if( RTL == bidirectionalLineInfo.direction )
+ {
+ length += glyphMetrics.advance;
+ }
+ else
+ {
+ whiteSpaceLengthEndOfLine += glyphMetrics.advance;
+ }
+ penX += glyphMetrics.advance;
+ }
+ else
+ {
+ if( LTR == bidirectionalLineInfo.direction )
+ {
+ whiteSpaceLengthEndOfLine = 0.f;
+ }
+ length = std::max( length, penX + glyphMetrics.xBearing + glyphMetrics.width );
+ penX += ( glyphMetrics.advance + parameters.interGlyphExtraAdvance );
+ }
+ }
+ }
+
+ void ReorderBiDiLayout( const Parameters& parameters,
+ LayoutBidiParameters& bidiParameters,
+ const LineLayout& currentLineLayout,
+ LineLayout& lineLayout,
+ bool breakInCharacters )
+ {
+ const Length* const charactersPerGlyphBuffer = parameters.textModel->mVisualModel->mCharactersPerGlyph.Begin();
+
+ // The last glyph to be laid-out.
+ const GlyphIndex lastGlyphOfParagraphPlusOne = parameters.startGlyphIndex + parameters.numberOfGlyphs;
+
+ const Vector<BidirectionalParagraphInfoRun>& bidirectionalParagraphsInfo = parameters.textModel->mLogicalModel->mBidirectionalParagraphInfo;
+
+ const BidirectionalParagraphInfoRun& bidirectionalParagraphInfo = bidirectionalParagraphsInfo[bidiParameters.bidiParagraphIndex];
+ if( ( lineLayout.characterIndex >= bidirectionalParagraphInfo.characterRun.characterIndex ) &&
+ ( lineLayout.characterIndex < bidirectionalParagraphInfo.characterRun.characterIndex + bidirectionalParagraphInfo.characterRun.numberOfCharacters ) )
+ {
+ Vector<BidirectionalLineInfoRun>& bidirectionalLinesInfo = parameters.textModel->mLogicalModel->mBidirectionalLineInfo;
+
+ // Sets the visual to logical map tables needed to reorder the text.
+ ReorderLine( bidirectionalParagraphInfo,
+ bidirectionalLinesInfo,
+ bidiParameters.bidiLineIndex,
+ lineLayout.characterIndex,
+ lineLayout.numberOfCharacters,
+ bidiParameters.paragraphDirection );
+
+ // Recalculate the length of the line and update the layout.
+ const BidirectionalLineInfoRun& bidirectionalLineInfo = *( bidirectionalLinesInfo.Begin() + bidiParameters.bidiLineIndex );
+
+ if( !bidirectionalLineInfo.isIdentity )
+ {
+ float length = 0.f;
+ float whiteSpaceLengthEndOfLine = 0.f;
+ LayoutRightToLeft( parameters,
+ bidirectionalLineInfo,
+ length,
+ whiteSpaceLengthEndOfLine );
+
+ lineLayout.whiteSpaceLengthEndOfLine = whiteSpaceLengthEndOfLine;
+ if( !Equals( length, lineLayout.length ) )
+ {
+ const bool isMultiline = mLayout == MULTI_LINE_BOX;
+
+ if( isMultiline && ( length > parameters.boundingBox.width ) )
+ {
+ if( breakInCharacters || ( isMultiline && ( 0u == currentLineLayout.numberOfGlyphs ) ) )
+ {
+ // The word doesn't fit in one line. It has to be split by character.
+
+ // Remove the last laid out glyph(s) as they doesn't fit.
+ for( GlyphIndex glyphIndex = lineLayout.glyphIndex + lineLayout.numberOfGlyphs - 1u; glyphIndex >= lineLayout.glyphIndex; )
+ {
+ const Length numberOfGLyphsInGroup = GetNumberOfGlyphsOfGroup( glyphIndex,
+ lastGlyphOfParagraphPlusOne,
+ charactersPerGlyphBuffer );
+
+ const Length numberOfCharacters = *( charactersPerGlyphBuffer + glyphIndex + numberOfGLyphsInGroup - 1u );
+
+ lineLayout.numberOfGlyphs -= numberOfGLyphsInGroup;
+ lineLayout.numberOfCharacters -= numberOfCharacters;
+
+ AdjustLayout( parameters,
+ bidiParameters,
+ bidirectionalParagraphInfo,
+ lineLayout );
+
+ if( lineLayout.length < parameters.boundingBox.width )
+ {
+ break;
+ }
+
+ if( glyphIndex < numberOfGLyphsInGroup )
+ {
+ // avoids go under zero for an unsigned int.
+ break;
+ }
+
+ glyphIndex -= numberOfGLyphsInGroup;
+ }
+ }
+ else
+ {
+ lineLayout = currentLineLayout;
+
+ AdjustLayout( parameters,
+ bidiParameters,
+ bidirectionalParagraphInfo,
+ lineLayout );
+ }
+ }
+ else
+ {
+ lineLayout.length = length;
+ }
+ }
+ }
+ }
+ }
+
+ void AdjustLayout( const Parameters& parameters,
+ LayoutBidiParameters& bidiParameters,
+ const BidirectionalParagraphInfoRun& bidirectionalParagraphInfo,
+ LineLayout& lineLayout )
+ {
+ Vector<BidirectionalLineInfoRun>& bidirectionalLinesInfo = parameters.textModel->mLogicalModel->mBidirectionalLineInfo;
+
+ // Remove current reordered line.
+ bidirectionalLinesInfo.Erase( bidirectionalLinesInfo.Begin() + bidiParameters.bidiLineIndex );
+
+ // Re-build the conversion table without the removed glyphs.
+ ReorderLine( bidirectionalParagraphInfo,
+ bidirectionalLinesInfo,
+ bidiParameters.bidiLineIndex,
+ lineLayout.characterIndex,
+ lineLayout.numberOfCharacters,
+ bidiParameters.paragraphDirection );
+
+ const BidirectionalLineInfoRun& bidirectionalLineInfo = *( bidirectionalLinesInfo.Begin() + bidiParameters.bidiLineIndex );
+
+ float length = 0.f;
+ float whiteSpaceLengthEndOfLine = 0.f;
+ LayoutRightToLeft( parameters,
+ bidirectionalLineInfo,
+ length,
+ whiteSpaceLengthEndOfLine );
+
+ lineLayout.length = length;
+ lineLayout.whiteSpaceLengthEndOfLine = whiteSpaceLengthEndOfLine;
+ }
+
/**
* Retrieves the line layout for a given box width.
*
- * @note This method lais out text as it were left to right. At this point is not possible to reorder the line
- * because the number of characters of the line is not known (one of the responsabilities of this method
- * is calculate that). Due to glyph's 'x' bearing, width and advance, when right to left or mixed right to left
- * and left to right text is laid-out, it can be small differences in the line length. One solution is to
- * reorder and re-lay out the text after this method and add or remove one extra glyph if needed. However,
- * this method calculates which are the first and last glyphs of the line (the ones that causes the
- * differences). This is a good point to check if there is problems with the text exceeding the boundaries
- * of the control when there is right to left text.
+ * @note This method starts to layout text as if it was left to right. However, it might be differences in the length
+ * of the line if it's a bidirectional one. If the paragraph is bidirectional, this method will call a function
+ * to reorder the line and recalculate its length.
*
+
* @param[in] parameters The layout parameters.
+ * @param[] bidiParameters Bidirectional info for the current line.
* @param[out] lineLayout The line layout.
- * @param[in,out] paragraphDirection in: the current paragraph's direction, out: the next paragraph's direction. Is set after a must break.
* @param[in] completelyFill Whether to completely fill the line ( even if the last word exceeds the boundaries ).
*/
void GetLineLayoutForBox( const Parameters& parameters,
+ LayoutBidiParameters& bidiParameters,
LineLayout& lineLayout,
- CharacterDirection& paragraphDirection,
bool completelyFill )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->GetLineLayoutForBox\n" );
const CharacterIndex* const glyphsToCharactersBuffer = parameters.textModel->mVisualModel->mGlyphsToCharacters.Begin();
const LineBreakInfo* const lineBreakInfoBuffer = parameters.textModel->mLogicalModel->mLineBreakInfo.Begin();
- const bool hasBidiParagraphs = !parameters.textModel->mLogicalModel->mBidirectionalParagraphInfo.Empty();
- const CharacterDirection* const characterDirectionBuffer = hasBidiParagraphs ? parameters.textModel->mLogicalModel->mCharacterDirections.Begin() : nullptr;
-
const float outlineWidth = static_cast<float>( parameters.textModel->GetOutlineWidth() );
const Length totalNumberOfGlyphs = parameters.textModel->mVisualModel->mGlyphs.Count();
// It needs to add as well space for the cursor if the text is in edit mode and extra space in case the text is outlined.
tmpLineLayout.penX = -glyphMetrics.xBearing + mCursorWidth + outlineWidth;
- // Initialize the advance of the previous glyph.
- tmpLineLayout.previousAdvance = 0.f;
-
// Calculate the line height if there is no characters.
FontId lastFontId = glyphMetrics.fontId;
UpdateLineHeight( glyphMetrics, tmpLineLayout );
const float previousTmpPenX = tmpLineLayout.penX;
const float previousTmpAdvance = tmpLineLayout.previousAdvance;
const float previousTmpLength = tmpLineLayout.length;
- const float previousTmpWsLengthEndOfLine = tmpLineLayout.wsLengthEndOfLine;
+ const float previousTmpWhiteSpaceLengthEndOfLine = tmpLineLayout.whiteSpaceLengthEndOfLine;
if( isWhiteSpace )
{
// Add the length to the length of white spaces at the end of the line.
- tmpLineLayout.wsLengthEndOfLine += glyphMetrics.advance; // The advance is used as the width is always zero for the white spaces.
+ tmpLineLayout.whiteSpaceLengthEndOfLine += glyphMetrics.advance; // The advance is used as the width is always zero for the white spaces.
}
else
{
- tmpLineLayout.penX += tmpLineLayout.previousAdvance + tmpLineLayout.wsLengthEndOfLine;
+ tmpLineLayout.penX += tmpLineLayout.previousAdvance + tmpLineLayout.whiteSpaceLengthEndOfLine;
tmpLineLayout.previousAdvance = ( glyphMetrics.advance + parameters.interGlyphExtraAdvance );
+
tmpLineLayout.length = tmpLineLayout.penX + glyphMetrics.xBearing + glyphMetrics.width;
// Clear the white space length at the end of the line.
- tmpLineLayout.wsLengthEndOfLine = 0.f;
+ tmpLineLayout.whiteSpaceLengthEndOfLine = 0.f;
}
// Check if the accumulated length fits in the width of the box.
tmpLineLayout.penX = previousTmpPenX;
tmpLineLayout.previousAdvance = previousTmpAdvance;
tmpLineLayout.length = previousTmpLength;
- tmpLineLayout.wsLengthEndOfLine = previousTmpWsLengthEndOfLine;
+ tmpLineLayout.whiteSpaceLengthEndOfLine = previousTmpWhiteSpaceLengthEndOfLine;
}
// Add part of the word to the line layout.
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--GetLineLayoutForBox.\n" );
+ // Reorder the RTL line.
+ if( bidiParameters.isBidirectional )
+ {
+ ReorderBiDiLayout( parameters,
+ bidiParameters,
+ lineLayout,
+ lineLayout,
+ true );
+ }
+
return;
}
if( ( isMultiline || isLastGlyph ) &&
( TextAbstraction::LINE_MUST_BREAK == lineBreakInfo ) )
{
+ LineLayout currentLineLayout = lineLayout;
+
// Must break the line. Update the line layout and return.
MergeLineLayout( lineLayout, tmpLineLayout );
- // Set the next paragraph's direction.
- if( !isLastGlyph &&
- ( nullptr != characterDirectionBuffer ) )
+ // Reorder the RTL line.
+ if( bidiParameters.isBidirectional )
{
- paragraphDirection = *( characterDirectionBuffer + 1u + characterLastIndex );
+ ReorderBiDiLayout( parameters,
+ bidiParameters,
+ currentLineLayout,
+ lineLayout,
+ false );
}
DALI_LOG_INFO( gLogFilter, Debug::Verbose, " Must break\n" );
}
}
+ void SetGlyphPositions( const Parameters& layoutParameters,
+ Vector2* glyphPositionsBuffer,
+ LayoutBidiParameters& layoutBidiParameters,
+ const LineLayout& layout )
+ {
+ const Character* const textBuffer = layoutParameters.textModel->mLogicalModel->mText.Begin();
+ const BidirectionalLineInfoRun& bidiLine = layoutParameters.textModel->mLogicalModel->mBidirectionalLineInfo[layoutBidiParameters.bidiLineIndex];
+ const GlyphInfo* const glyphsBuffer = layoutParameters.textModel->mVisualModel->mGlyphs.Begin();
+ const GlyphIndex* const charactersToGlyphsBuffer = layoutParameters.textModel->mVisualModel->mCharactersToGlyph.Begin();
+ const Length* const glyphsPerCharacterBuffer = layoutParameters.textModel->mVisualModel->mGlyphsPerCharacter.Begin();
+
+ CharacterIndex characterLogicalIndex = 0u;
+ CharacterIndex characterVisualIndex = bidiLine.characterRun.characterIndex + *( bidiLine.visualToLogicalMap + characterLogicalIndex );
+
+ float penX = 0.f;
+ while( TextAbstraction::IsWhiteSpace( *( textBuffer + characterVisualIndex ) ) )
+ {
+ const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex );
+ const GlyphInfo& glyph = *( glyphsBuffer + glyphIndex );
+
+ Vector2& position = *( glyphPositionsBuffer + glyphIndex - layoutParameters.startGlyphIndex );
+ position.x = penX;
+ position.y = -glyph.yBearing;
+
+ penX += glyph.advance;
+
+ ++characterLogicalIndex;
+ characterVisualIndex = bidiLine.characterRun.characterIndex + *( bidiLine.visualToLogicalMap + characterLogicalIndex );
+ }
+
+ const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex );
+ const GlyphInfo& glyph = *( glyphsBuffer + glyphIndex );
+
+ penX += -glyph.xBearing;
+
+ // Traverses the characters of the right to left paragraph.
+ for( ; characterLogicalIndex < bidiLine.characterRun.numberOfCharacters;
+ ++characterLogicalIndex )
+ {
+ // Convert the character in the logical order into the character in the visual order.
+ const CharacterIndex characterVisualIndex = bidiLine.characterRun.characterIndex + *( bidiLine.visualToLogicalMap + characterLogicalIndex );
+
+ // Get the number of glyphs of the character.
+ const Length numberOfGlyphs = *( glyphsPerCharacterBuffer + characterVisualIndex );
+
+ for( GlyphIndex index = 0u; index < numberOfGlyphs; ++index )
+ {
+ // Convert the character in the visual order into the glyph in the visual order.
+ const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex ) + index;
+
+ DALI_ASSERT_DEBUG( 0u <= glyphIndex && glyphIndex < layoutParameters.textModel->mVisualModel->mGlyphs.Count() );
+
+ const GlyphInfo& glyph = *( glyphsBuffer + glyphIndex );
+ Vector2& position = *( glyphPositionsBuffer + glyphIndex - layoutParameters.startGlyphIndex );
+
+ position.x = std::round( penX + glyph.xBearing );
+ position.y = -glyph.yBearing;
+
+ penX += ( glyph.advance + layoutParameters.interGlyphExtraAdvance );
+ }
+ }
+ }
+
/**
* @brief Resizes the line buffer.
*
* return Whether the line is ellipsized.
*/
bool EllipsisLine( const Parameters& layoutParameters,
+ LayoutBidiParameters& layoutBidiParameters,
const LineLayout& layout,
Size& layoutSize,
LineRun* linesBuffer,
Vector2* glyphPositionsBuffer,
Length& numberOfLines,
float penY,
- CharacterDirection currentParagraphDirection,
bool& isAutoScrollEnabled )
{
const bool ellipsis = isAutoScrollEnabled ? ( penY - layout.descender > layoutParameters.boundingBox.height ) :
}
GetLineLayoutForBox( layoutParameters,
+ layoutBidiParameters,
ellipsisLayout,
- currentParagraphDirection,
true );
lineRun->glyphRun.numberOfGlyphs = ellipsisLayout.numberOfGlyphs;
lineRun->characterRun.characterIndex = ellipsisLayout.characterIndex;
lineRun->characterRun.numberOfCharacters = ellipsisLayout.numberOfCharacters;
lineRun->width = ellipsisLayout.length;
- lineRun->extraLength = std::ceil( ellipsisLayout.wsLengthEndOfLine );
+ lineRun->extraLength = std::ceil( ellipsisLayout.whiteSpaceLengthEndOfLine );
lineRun->ascender = ellipsisLayout.ascender;
lineRun->descender = ellipsisLayout.descender;
- lineRun->direction = LTR;
lineRun->ellipsis = true;
layoutSize.width = layoutParameters.boundingBox.width;
const GlyphInfo* const glyphsBuffer = layoutParameters.textModel->mVisualModel->mGlyphs.Begin();
const float outlineWidth = static_cast<float>( layoutParameters.textModel->GetOutlineWidth() );
- SetGlyphPositions( glyphsBuffer + lineRun->glyphRun.glyphIndex,
- ellipsisLayout.numberOfGlyphs,
- outlineWidth,
- layoutParameters.interGlyphExtraAdvance,
- glyphPositionsBuffer + lineRun->glyphRun.glyphIndex - layoutParameters.startGlyphIndex );
+ const Vector<BidirectionalLineInfoRun>& bidirectionalLinesInfo = layoutParameters.textModel->mLogicalModel->mBidirectionalLineInfo;
+
+ if( layoutBidiParameters.isBidirectional )
+ {
+ layoutBidiParameters.bidiLineIndex = 0u;
+ for( Vector<BidirectionalLineInfoRun>::ConstIterator it = bidirectionalLinesInfo.Begin(),
+ endIt = bidirectionalLinesInfo.End();
+ it != endIt;
+ ++it, ++layoutBidiParameters.bidiLineIndex )
+ {
+ const BidirectionalLineInfoRun& run = *it;
+
+ if( ellipsisLayout.characterIndex == run.characterRun.characterIndex )
+ {
+ // Found where to insert the bidi line info.
+ break;
+ }
+ }
+ }
+
+ const BidirectionalLineInfoRun* const bidirectionalLineInfo = ( layoutBidiParameters.isBidirectional && !bidirectionalLinesInfo.Empty() ) ? &bidirectionalLinesInfo[layoutBidiParameters.bidiLineIndex] : nullptr;
+
+ if( ( nullptr != bidirectionalLineInfo ) &&
+ !bidirectionalLineInfo->isIdentity &&
+ ( ellipsisLayout.characterIndex == bidirectionalLineInfo->characterRun.characterIndex ) )
+ {
+ lineRun->direction = RTL;
+ SetGlyphPositions( layoutParameters,
+ glyphPositionsBuffer,
+ layoutBidiParameters,
+ ellipsisLayout );
+ }
+ else
+ {
+ lineRun->direction = LTR;
+ SetGlyphPositions( glyphsBuffer + lineRun->glyphRun.glyphIndex,
+ ellipsisLayout.numberOfGlyphs,
+ outlineWidth,
+ layoutParameters.interGlyphExtraAdvance,
+ glyphPositionsBuffer + lineRun->glyphRun.glyphIndex - layoutParameters.startGlyphIndex );
+ }
}
return ellipsis;
if( isLastLine && !layoutParameters.isLastNewParagraph )
{
- const float width = layout.length + layout.wsLengthEndOfLine;
- if( MULTI_LINE_BOX == mLayout )
+ lineRun.width = layout.length;
+ if( LTR == layout.direction )
{
- lineRun.width = ( width > layoutParameters.boundingBox.width ) ? layoutParameters.boundingBox.width : width;
+ lineRun.width += layout.whiteSpaceLengthEndOfLine;
+ lineRun.extraLength = 0.f;
}
else
{
- lineRun.width = width;
+ lineRun.extraLength = layout.whiteSpaceLengthEndOfLine;
}
-
- lineRun.extraLength = 0.f;
}
else
{
lineRun.width = layout.length;
- lineRun.extraLength = std::ceil( layout.wsLengthEndOfLine );
+ lineRun.extraLength = std::ceil( layout.whiteSpaceLengthEndOfLine );
}
// Rounds upward to avoid a non integer size.
lineRun.ascender = layout.ascender;
lineRun.descender = layout.descender;
- lineRun.direction = LTR;
+ lineRun.direction = layout.direction;
lineRun.ellipsis = false;
// Update the actual size.
}
}
- bool LayoutText( const Parameters& layoutParameters,
- Vector<Vector2>& glyphPositions,
- Vector<LineRun>& lines,
+ bool LayoutText( Parameters& layoutParameters,
Size& layoutSize,
bool elideTextEnabled,
bool& isAutoScrollEnabled )
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->LayoutText\n" );
DALI_LOG_INFO( gLogFilter, Debug::Verbose, " box size %f, %f\n", layoutParameters.boundingBox.width, layoutParameters.boundingBox.height );
+ Vector<LineRun>& lines = layoutParameters.textModel->mVisualModel->mLines;
+
if( 0u == layoutParameters.numberOfGlyphs )
{
// Add an extra line if the last character is a new paragraph character and the last line doesn't have zero characters.
const GlyphIndex lastGlyphPlusOne = layoutParameters.startGlyphIndex + layoutParameters.numberOfGlyphs;
const Length totalNumberOfGlyphs = layoutParameters.textModel->mVisualModel->mGlyphs.Count();
+ Vector<Vector2>& glyphPositions = layoutParameters.textModel->mVisualModel->mGlyphPositions;
// In a previous layout, an extra line with no characters may have been added if the text ended with a new paragraph character.
// This extra line needs to be removed.
// Retrieve BiDi info.
const bool hasBidiParagraphs = !layoutParameters.textModel->mLogicalModel->mBidirectionalParagraphInfo.Empty();
- const CharacterDirection* const characterDirectionBuffer = hasBidiParagraphs ? layoutParameters.textModel->mLogicalModel->mCharacterDirections.Begin() : nullptr;
+ const CharacterIndex* const glyphsToCharactersBuffer = hasBidiParagraphs ? layoutParameters.textModel->mVisualModel->mGlyphsToCharacters.Begin() : nullptr;
+ const Vector<BidirectionalParagraphInfoRun>& bidirectionalParagraphsInfo = layoutParameters.textModel->mLogicalModel->mBidirectionalParagraphInfo;
+ const Vector<BidirectionalLineInfoRun>& bidirectionalLinesInfo = layoutParameters.textModel->mLogicalModel->mBidirectionalLineInfo;
- // Set the first paragraph's direction.
- CharacterDirection paragraphDirection = ( nullptr != characterDirectionBuffer ) ? *characterDirectionBuffer : LTR;
+ // Set the layout bidirectional paramters.
+ LayoutBidiParameters layoutBidiParameters;
// Whether the layout is being updated or set from scratch.
const bool updateCurrentBuffer = layoutParameters.numberOfGlyphs < totalNumberOfGlyphs;
linesBuffer = lines.Begin();
}
-
- const GlyphInfo* const glyphsBuffer = layoutParameters.textModel->mVisualModel->mGlyphs.Begin();
- const float outlineWidth = static_cast<float>( layoutParameters.textModel->GetOutlineWidth() );
-
float penY = CalculateLineOffset( lines,
layoutParameters.startLineIndex );
-
-
for( GlyphIndex index = layoutParameters.startGlyphIndex; index < lastGlyphPlusOne; )
{
- CharacterDirection currentParagraphDirection = paragraphDirection;
+ layoutBidiParameters.Clear();
+
+ if( hasBidiParagraphs )
+ {
+ const CharacterIndex startCharacterIndex = *( glyphsToCharactersBuffer + index );
+
+ for( Vector<BidirectionalParagraphInfoRun>::ConstIterator it = bidirectionalParagraphsInfo.Begin(),
+ endIt = bidirectionalParagraphsInfo.End();
+ it != endIt;
+ ++it, ++layoutBidiParameters.bidiParagraphIndex )
+ {
+ const BidirectionalParagraphInfoRun& run = *it;
+
+ const CharacterIndex lastCharacterIndex = run.characterRun.characterIndex + run.characterRun.numberOfCharacters;
+
+ if( lastCharacterIndex <= startCharacterIndex )
+ {
+ // Do not process, the paragraph has already been processed.
+ continue;
+ }
+
+ if( startCharacterIndex >= run.characterRun.characterIndex && startCharacterIndex < lastCharacterIndex )
+ {
+ layoutBidiParameters.paragraphDirection = run.direction;
+ layoutBidiParameters.isBidirectional = true;
+ }
+
+ // Has already been found.
+ break;
+ }
+
+ if( layoutBidiParameters.isBidirectional )
+ {
+ for( Vector<BidirectionalLineInfoRun>::ConstIterator it = bidirectionalLinesInfo.Begin(),
+ endIt = bidirectionalLinesInfo.End();
+ it != endIt;
+ ++it, ++layoutBidiParameters.bidiLineIndex )
+ {
+ const BidirectionalLineInfoRun& run = *it;
+
+ const CharacterIndex lastCharacterIndex = run.characterRun.characterIndex + run.characterRun.numberOfCharacters;
+
+ if( lastCharacterIndex <= startCharacterIndex )
+ {
+ // skip
+ continue;
+ }
+
+ if( startCharacterIndex < lastCharacterIndex )
+ {
+ // Found where to insert the bidi line info.
+ break;
+ }
+ }
+ }
+ }
+
+ CharacterDirection currentParagraphDirection = layoutBidiParameters.paragraphDirection;
// Get the layout for the line.
LineLayout layout;
+ layout.direction = layoutBidiParameters.paragraphDirection;
layout.glyphIndex = index;
GetLineLayoutForBox( layoutParameters,
+ layoutBidiParameters,
layout,
- paragraphDirection,
false );
DALI_LOG_INFO( gLogFilter, Debug::Verbose, " glyph index %d\n", layout.glyphIndex );
bool ellipsis = false;
if( elideTextEnabled )
{
+ layoutBidiParameters.paragraphDirection = currentParagraphDirection;
+
// Does the ellipsis of the last line.
ellipsis = EllipsisLine( layoutParameters,
+ layoutBidiParameters,
layout,
layoutSize,
linesBuffer,
glyphPositionsBuffer,
numberOfLines,
penY,
- currentParagraphDirection,
isAutoScrollEnabled );
}
if( numberOfLines == linesCapacity )
{
+
// Reserve more space for the next lines.
linesBuffer = ResizeLinesBuffer( lines,
newLines,
numberOfLines );
} // whether to add a last line.
- // Sets the positions of the glyphs.
- SetGlyphPositions( glyphsBuffer + index,
- layout.numberOfGlyphs,
- outlineWidth,
- layoutParameters.interGlyphExtraAdvance,
- glyphPositionsBuffer + index - layoutParameters.startGlyphIndex );
+ const GlyphInfo* const glyphsBuffer = layoutParameters.textModel->mVisualModel->mGlyphs.Begin();
+ const float outlineWidth = static_cast<float>( layoutParameters.textModel->GetOutlineWidth() );
+
+ const BidirectionalLineInfoRun* const bidirectionalLineInfo = ( layoutBidiParameters.isBidirectional && !bidirectionalLinesInfo.Empty() ) ? &bidirectionalLinesInfo[layoutBidiParameters.bidiLineIndex] : nullptr;
+
+ if( ( nullptr != bidirectionalLineInfo ) &&
+ !bidirectionalLineInfo->isIdentity &&
+ ( layout.characterIndex == bidirectionalLineInfo->characterRun.characterIndex ) )
+ {
+ SetGlyphPositions( layoutParameters,
+ glyphPositionsBuffer,
+ layoutBidiParameters,
+ layout );
+ }
+ else
+ {
+
+ // Sets the positions of the glyphs.
+ SetGlyphPositions( glyphsBuffer + index,
+ layout.numberOfGlyphs,
+ outlineWidth,
+ layoutParameters.interGlyphExtraAdvance,
+ glyphPositionsBuffer + index - layoutParameters.startGlyphIndex );
+ }
// Updates the vertical pen's position.
penY += -layout.descender + layout.lineSpacing + mDefaultLineSpacing;
return true;
}
- void ReLayoutRightToLeftLines( const Parameters& layoutParameters,
- CharacterIndex startIndex,
- Length numberOfCharacters,
- Vector<Vector2>& glyphPositions )
- {
- const GlyphInfo* const glyphsBuffer = layoutParameters.textModel->mVisualModel->mGlyphs.Begin();
- const GlyphIndex* const charactersToGlyphsBuffer = layoutParameters.textModel->mVisualModel->mCharactersToGlyph.Begin();
- const Length* const glyphsPerCharacterBuffer = layoutParameters.textModel->mVisualModel->mGlyphsPerCharacter.Begin();
- const float outlineWidth = static_cast<float>( layoutParameters.textModel->GetOutlineWidth() );
-
- const CharacterIndex lastCharacterIndex = startIndex + numberOfCharacters;
-
- // Traverses the paragraphs with right to left characters.
- for( LineIndex lineIndex = 0u; lineIndex < layoutParameters.numberOfBidirectionalInfoRuns; ++lineIndex )
- {
- const BidirectionalLineInfoRun& bidiLine = *( layoutParameters.lineBidirectionalInfoRunsBuffer + lineIndex );
-
- if( startIndex >= bidiLine.characterRun.characterIndex + bidiLine.characterRun.numberOfCharacters )
- {
- // Do not reorder the line if it has been already reordered.
- continue;
- }
-
- if( bidiLine.characterRun.characterIndex >= lastCharacterIndex )
- {
- // Do not reorder the lines after the last requested character.
- break;
- }
-
- const CharacterIndex characterVisualIndex = bidiLine.characterRun.characterIndex + *bidiLine.visualToLogicalMap;
- const GlyphInfo& glyph = *( glyphsBuffer + *( charactersToGlyphsBuffer + characterVisualIndex ) );
-
- float penX = -glyph.xBearing + outlineWidth + mCursorWidth;
-
- Vector2* glyphPositionsBuffer = glyphPositions.Begin();
-
- // Traverses the characters of the right to left paragraph.
- for( CharacterIndex characterLogicalIndex = 0u;
- characterLogicalIndex < bidiLine.characterRun.numberOfCharacters;
- ++characterLogicalIndex )
- {
- // Convert the character in the logical order into the character in the visual order.
- const CharacterIndex characterVisualIndex = bidiLine.characterRun.characterIndex + *( bidiLine.visualToLogicalMap + characterLogicalIndex );
-
- // Get the number of glyphs of the character.
- const Length numberOfGlyphs = *( glyphsPerCharacterBuffer + characterVisualIndex );
-
- for( GlyphIndex index = 0u; index < numberOfGlyphs; ++index )
- {
- // Convert the character in the visual order into the glyph in the visual order.
- const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex ) + index;
-
- DALI_ASSERT_DEBUG( 0u <= glyphIndex && glyphIndex < layoutParameters.textModel->mVisualModel->mGlyphs.Count() );
-
- const GlyphInfo& glyph = *( glyphsBuffer + glyphIndex );
- Vector2& position = *( glyphPositionsBuffer + glyphIndex );
-
- position.x = std::round( penX + glyph.xBearing );
- penX += ( glyph.advance + layoutParameters.interGlyphExtraAdvance );
- }
- }
- }
- }
-
void Align( const Size& size,
CharacterIndex startIndex,
Length numberOfCharacters,
{
line.alignmentOffset = 0.f;
const bool isLineRTL = RTL == line.direction;
+
// Whether to swap the alignment.
// Swap if the line is RTL and is not required to match the direction of the system's language or if it's required to match the direction of the system's language and it's RTL.
bool isLayoutRTL = isLineRTL;
};
Engine::Engine()
-: mImpl( nullptr )
+: mImpl{ nullptr }
{
mImpl = new Engine::Impl();
}
return static_cast<int>( mImpl->mCursorWidth );
}
-bool Engine::LayoutText( const Parameters& layoutParameters,
- Vector<Vector2>& glyphPositions,
- Vector<LineRun>& lines,
+bool Engine::LayoutText( Parameters& layoutParameters,
Size& layoutSize,
bool elideTextEnabled,
bool& isAutoScrollEnabled )
{
return mImpl->LayoutText( layoutParameters,
- glyphPositions,
- lines,
layoutSize,
elideTextEnabled,
isAutoScrollEnabled );
}
-void Engine::ReLayoutRightToLeftLines( const Parameters& layoutParameters,
- CharacterIndex startIndex,
- Length numberOfCharacters,
- Vector<Vector2>& glyphPositions )
-{
- mImpl->ReLayoutRightToLeftLines( layoutParameters,
- startIndex,
- numberOfCharacters,
- glyphPositions );
-}
-
void Engine::Align( const Size& size,
CharacterIndex startIndex,
Length numberOfCharacters,