+ pos_type x2pos(int &x) const;
+ /** Break the element in two if possible, so that its width is less
+ * than \param w.
+ * \return a vector of elements containing the remainder of
+ * the text (empty if nothing happened).
+ * \param width maximum width of the row.
+ * \param next_width available width on next row.
+ * \param force: if true, cut string at any place, even for
+ * languages that wrap at word delimiters; if false, do not
+ * break at all if first element would larger than \c width.
+ */
+ // FIXME: ideally last parameter should be Elements&, but it is not possible.
+ bool splitAt(int width, int next_width, bool force, std::vector<Element> & tail);
+ // remove trailing spaces (useful for end of row)
+ void rtrim();
+
+ //
+ bool isRTL() const { return font.isVisibleRightToLeft(); }
+ // This is true for virtual elements.
+ bool isVirtual() const { return type == VIRTUAL; }
+
+ // Returns the position on left side of the element.
+ pos_type left_pos() const { return isRTL() ? endpos : pos; };
+ // Returns the position on right side of the element.
+ pos_type right_pos() const { return isRTL() ? pos : endpos; };