A text engine is responsible for rendering texts for a specific text format. They are used by QwtText to render a text.
QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library, other text engines can be loaded as plugins.
The Qt Solution package includes a renderer for MathML, that could be used successfully for an implementation of a MathML text plugin. Unfortunately the QtMml implementation needs a lot of patches to export interfaces to be usable from Qwt, that can't be published without violation of the Qt Solution license. ( See textengines/mathml, and read the comments in mathml.pro. )
Definition at line 43 of file qwt_text_engine.h.
Public Member Functions | |
virtual | ~QwtTextEngine () |
virtual int | heightForWidth (const QFont &font, int flags, const QString &text, int width) const =0 |
virtual QSize | textSize (const QFont &font, int flags, const QString &text) const =0 |
virtual bool | mightRender (const QString &text) const =0 |
virtual void | textMargins (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const =0 |
virtual void | draw (QPainter *painter, const QRect &rect, int flags, const QString &text) const =0 |
Protected Member Functions | |
QwtTextEngine () |
|
Destructor.
Definition at line 126 of file qwt_text_engine.cpp. |
|
Constructor.
Definition at line 121 of file qwt_text_engine.cpp. |
|
Draw the text in a clipping rectangle
Implemented in QwtPlainTextEngine, and QwtRichTextEngine. |
|
Find the height for a given width
Implemented in QwtPlainTextEngine, and QwtRichTextEngine. |
|
Test if a string can be rendered by this text engine
Implemented in QwtPlainTextEngine, and QwtRichTextEngine. |
|
Return margins around the texts The textSize might include margins around the text, like QFontMetrics::descent. In situations where texts need to be aligend in detail, knowing these margins might improve the layout calculations.
Implemented in QwtPlainTextEngine, and QwtRichTextEngine. |
|
Returns the size, that is needed to render text
Implemented in QwtPlainTextEngine, and QwtRichTextEngine. |