- * @param[in] boundingBox The size of the box containing the text.
- * @param[in] glyphs A vector with glyphs.
- * @param[in] characterIndices Vector with indices pointing the first character of each glyph.
- * @param[in] charactersPerGlyph Vector with the number of characters that forms each glyph.
- * @param[in] visualModel The visual model to update.
+ * @param[in] layoutParameters The parameters needed to layout the text.
+ * @param[out] glyphPositions The positions of all the glyphs.
+ * @param[out] lines The laid-out lines.
+ * @param[out] actualSize The size of the text after it has been laid-out.
+ *
+ * @return \e true if the text has been re-laid-out. \e false means the given width is too small to layout even a single character.
+ */
+ bool LayoutText( const LayoutParameters& layoutParameters,
+ Vector<Vector2>& glyphPositions,
+ Vector<LineRun>& lines,
+ Size& actualSize );
+
+ /**
+ * @brief Re-lays out those lines with right to left characters.
+ *
+ * It doesn't change the phisical position of the glyphs in the model but sets their new position.
+ *
+ * @param[in] layoutParameters The parameters needed to layout the text.
+ * @param[in,out] glyphPositions The positions of all the glyphs.
+ */
+ void ReLayoutRightToLeftLines( const LayoutParameters& layoutParameters,
+ Vector<Vector2>& glyphPositions );
+
+ /**
+ * @brief Aligns the laid out lines.
+ *
+ * @param[in] layoutSize The size of the laid out the text.
+ * @param[in,out] lines The laid-out lines.