24#ifndef JKQTMATHTEXTTEXTNODE_H
25#define JKQTMATHTEXTTEXTNODE_H
26#include "jkqtmathtext/jkqtmathtext_imexport.h"
27#include "jkqtmathtext/jkqtmathtexttools.h"
28#include "jkqtmathtext/nodes/jkqtmathtextnode.h"
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
subclass representing one node in the syntax tree
Definition jkqtmathtextnode.h:37
base class for nodes representing text in the syntax tree
Definition jkqtmathtexttextnode.h:44
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
convert node to HTML and returns true on success
JKQTMathTextTextBaseNode(JKQTMathText *parent, const QString &text)
virtual QString textTransform(const QString &text, const JKQTMathTextEnvironment ¤tEv) const
transforms the text before sizing/drawing (may e.g. exchange special letters for other unicode symbol...
QString text
text-contents of the node
Definition jkqtmathtexttextnode.h:54
virtual ~JKQTMathTextTextBaseNode() override
QString getText() const
text-contents of the node
subclass representing one text node in the syntax tree
Definition jkqtmathtexttextnode.h:63
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override
determine the size of the node, overwrite this function in derived classes
void splitTextForLayout(QPainter &painter, JKQTMathTextEnvironment currentEv, const QString &txt, QStringList &textpart, QList< FontMode > &fontMode) const
split text for Math-Modelayout into sections, where each section has a defined way of output
FontMode
defines how a character shold be drawn, used by splitTextForLayout
Definition jkqtmathtexttextnode.h:77
@ FMasDefined
use current font
Definition jkqtmathtexttextnode.h:78
@ FMfallbackSymbol
use JKQTMathText::getFallbackFontSymbols()
Definition jkqtmathtexttextnode.h:82
@ FMasDefinedOutline
use current font and draw as outline, e.g. used for simulating blackboard fonts
Definition jkqtmathtexttextnode.h:80
@ FMroman
use JKQTMathText::getFontRoman()
Definition jkqtmathtexttextnode.h:81
@ FMasDefinedForceUpright
use current font, but force it upright (e.g. for digits in math mode)
Definition jkqtmathtexttextnode.h:79
virtual QString textTransform(const QString &text, const JKQTMathTextEnvironment ¤tEv) const override
transforms the text before sizing/drawing (may e.g. exchange special letters for other unicode symbol...
JKQTMathTextTextNode(JKQTMathText *parent, const QString &text, bool addWhitespace, bool stripInnerWhitepace=false)
void removeLeadingWhitespace()
remove leading whitespace, is used by simplifyJKQTMathTextNode()
static const QHash< QChar, uint32_t > & blackboardUnicodeTable()
translation table for blackboard-font characters from "normal" Latin-1 encoding to unicode-encoding o...
void removeTrailingWhitespace()
remove trailing whitespace, is used by simplifyJKQTMathTextNode()
virtual ~JKQTMathTextTextNode() override
LayoutInfo calcLayout(QPainter &painter, JKQTMathTextEnvironment currentEv) const
calculates the size of the node, much like JKQTMathTextNode::getSizeInternal(), but returns additiona...
virtual QString getTypeName() const override
return the name of this class as a string
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
draw the contents at the designated position
#define JKQTMATHTEXT_LIB_EXPORT
Definition jkqtmathtext_imexport.h:108
describes the current drawing environment (base fontname ...)
Definition jkqtmathtexttools.h:304
beschreibt die Größe(n) eines Knotens
Definition jkqtmathtexttools.h:393
describes the layout of the whole node
Definition jkqtmathtexttextnode.h:88
LayoutInfo & operator=(const JKQTMathTextNodeSize &other)
QStringList textpart
the text that shall be printed is split up into different parts (with different formatting each)
Definition jkqtmathtexttextnode.h:95
QList< FontMode > fontMode
formatting for each entry in textpart
Definition jkqtmathtexttextnode.h:97
LayoutInfo & operator=(const LayoutInfo &other)
LayoutInfo(const LayoutInfo &other)
LayoutInfo(const JKQTMathTextNodeSize &other)
QList< double > textpartXPos
drawing x-position for each entry in textpart
Definition jkqtmathtexttextnode.h:99