+ /**
+ * @brief Updates the indices of the character and glyph runs of the lines before the new lines are inserted.
+ *
+ * @param[in] layoutParameters The parameters needed to layout the text.
+ * @param[in,out] lines The vector of lines (before the new laid-out lines are inserted).
+ * @param[in] characterOffset The offset to be added to the runs of characters.
+ * @param[in] glyphOffset The offset to be added to the runs of glyphs.
+ */
+ void UpdateLineIndexOffsets( const LayoutParameters& layoutParameters,
+ Vector<LineRun>& lines,
+ Length characterOffset,
+ Length glyphOffset )
+ {
+ // Update the glyph and character runs.
+ for( Vector<LineRun>::Iterator it = lines.Begin() + layoutParameters.startLineIndex,
+ endIt = lines.End();
+ it != endIt;
+ ++it )
+ {
+ LineRun& line = *it;
+
+ line.glyphRun.glyphIndex = glyphOffset;
+ line.characterRun.characterIndex = characterOffset;
+
+ glyphOffset += line.glyphRun.numberOfGlyphs;
+ characterOffset += line.characterRun.numberOfCharacters;
+ }
+ }
+
+ bool LayoutText( const LayoutParameters& layoutParameters,
+ Vector<Vector2>& glyphPositions,
+ Vector<LineRun>& lines,
+ Size& layoutSize )
+ {
+ 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 );
+
+ 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.
+ if( layoutParameters.isLastNewParagraph )
+ {
+ Length numberOfLines = lines.Count();
+ if( 0u != numberOfLines )