+ /** Return character position that is the closest to
+ * pixel position \param x. The value \param x is
+ * adjusted to the actual pixel position.
+ */
+ pos_type x2pos(int &x) const;
+ /** Break the element in two if possible, so that its width is less
+ * than the required values.
+ * \return true if something has been done ; false if this is
+ * not needed or not possible.
+ * \param width: maximum width of the row.
+ * \param next_width: available width on next rows.
+ * \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.
+ * \param tail: a vector of elements where the remainder of
+ * the text will be appended (empty if nothing happened).
+ */
+ // 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; }