212 AddSpaceBeforeAndAfter = 0x01,
213 StartWithMathMode = 0x02,
214 AllowLinebreaks = 0x04,
215 DefaultParseOptions=AllowLinebreaks,
222 DefaultParser=LatexParser
241 template <
class TParser>
243 static_assert(std::is_base_of<JKQTMathTextParser, TParser>::value,
"in parse<TParser>() the type TParser has to be derived from JKQTMathTextParser to work!");
244 std::unique_ptr<TParser> p=std::unique_ptr<TParser>(
new TParser(
this));
247 parsedNode=p->parse(markup, options);
248 return parsedNode!=
nullptr;
269 void getSizeDetail(QPainter& painter,
double& width,
double& ascent,
double& descent,
double& strikeoutPos);
287 void draw(QPainter& painter, QPointF x,
bool drawBoxes=
false);
298 double draw(QPainter& painter,
double x,
double y,
bool drawBoxes=
false);
312 void draw(QPainter& painter,
unsigned int flags, QRectF rect,
bool drawBoxes=
false);
321 QPixmap
drawIntoPixmap(
bool drawBoxes=
false, QColor backgroundColor=QColor(Qt::white),
int sizeincrease=0, qreal devicePixelRatio=1.0);
331 QImage
drawIntoImage(
bool drawBoxes=
false, QColor backgroundColor=QColor(Qt::white),
int sizeincrease=0, qreal devicePixelRatio=1.0,
unsigned int resolution_dpi=96);
341 QString
toHtml(
bool* ok=
nullptr,
double fontPointSize=10);
349 BaseFontItalic = 0x02,
350 BaseFontUnderlined = 0x04,
351 BaseFontSmallCaps = 0x08,
352 BaseFontDefault=0x00,
361 void setFontColor(const QColor & __value);
363 QColor getFontColor() const;
365 void setFontSize(
double __value);
368 void setFontPointSize(
double __value);
371 void setFontSizePixels(
double __value);
374 double getFontPointSize() const;
376 double getFontSize() const;
379 double getFontSizePixels() const;
407 void addReplacementFont(const QString& nonUseFont, const QString& useFont);
465 void setFontSpecial(const QString& fontSpec);
478 QString getFontRoman() const;
485 QString getFontSans() const;
492 QString getFontTypewriter() const;
499 QString getFontScript() const;
506 QString getFontFraktur() const;
513 QString getFontCaligraphic() const;
525 QString getFontBlackboard() const;
532 QString getFallbackFontSymbols() const;
558 QString getFontMathRoman() const;
565 QString getFontMathSans() const;
586 bool useSTIX(
bool mathModeOnly=true,
bool useAsFallbackSymbol=true);
608 bool useXITS(
bool mathModeOnly=true,
bool useAsFallbackSymbol=true);
630 bool useFiraMath(
bool mathModeOnly=true,
bool useAsFallbackSymbol=true);
647 bool useASANA(
bool mathModeOnly=true,
bool useAsFallbackSymbol=true);
699 void loadSettings(const QSettings& settings, const QString& group=QString("mathtext/"));
701 void saveSettings(QSettings& settings, const QString& group=QString("mathtext/")) const;
704 void setBraceFactor(
double __value);
706 double getBraceFactor() const;
708 void setSubsuperSizeFactor(
double __value);
710 double getSubsuperSizeFactor() const;
712 void setSubsuperModeSelectionBySizeFactor(
double __value);
714 double getSubsuperModeSelectionBySizeFactor() const;
716 void setOperatorsubsuperSizeFactor(
double __value);
718 double getOperatorsubsuperSizeFactor() const;
720 void setOperatorsubsuperDistanceFactor(
double __value);
722 double getOperatorsubsuperDistanceFactor() const;
724 void setOperatorsubsuperExtraSpaceFactor(
double __value);
726 double getOperatorsubsuperExtraSpaceFactor() const;
728 void setMathoperatorWidthFactor(
double __value);
730 double getMathoperatorWidthFactor() const;
732 void setIntSubSuperXCorrectionFactor(
double __value);
734 double getIntSubSuperXCorrectionFactor() const;
736 void setIntSubBesidesXCorrectionXFactor(
double __value);
738 double getIntSubBesidesXCorrectionXFactor() const;
740 void setBigMathoperatorFontFactor(
double __value);
742 double getBigMathoperatorFontFactor() const;
744 void setSuperShiftFactor(
double __value);
746 double getSuperShiftFactor() const;
748 void setSubShiftFactor(
double __value);
750 double getSubShiftFactor() const;
752 void setSpecialSuperShiftFactor(
double __value);
754 double getSpecialSuperShiftFactor() const;
756 void setSpecialSubShiftFactor(
double __value);
758 double getSpecialSubShiftFactor() const;
760 void setUnderbraceFactor(
double __value);
762 double getUnderbraceFactor() const;
764 void setUnderbraceSeparationXFactor(
double __value);
766 double getUnderbraceSeparationXFactor() const;
768 void setUnderbraceBraceSizeXFactor(
double __value);
770 double getUnderbraceBraceSizeXFactor() const;
772 void setUndersetFactor(
double __value);
774 double getUndersetFactor() const;
776 void setFracFactor(
double __value);
778 double getFracFactor() const;
780 void setFracNestedFactor(
double __value);
782 double getFracNestedFactor() const;
786 void setFracShiftFactor(
double __value);
788 double getFracShiftFactor() const;
790 void setBraceYShiftFactor(
double __value);
792 double getBraceYShiftFactor() const;
795 void setDecorationHeightFactor(
double __value);
797 double getDecorationHeightFactor() const;
799 void setDecorationSeparationXFactor(
double __value);
801 double getDecorationSeparationFactor() const;
803 void setDecorationWidthReductionFactor(
double __value);
805 double getDecorationWidthReductionXFactor() const;
809 void setSqrtWidthXFactor(
double __value);
811 double getSqrtWidthXFactor() const;
813 void setSqrtHeightFactor(
double __value);
815 double getSqrtHeightFactor() const;
817 void setSqrtSmallFontFactor(
double __value);
819 double getSqrtSmallFontFactor() const;
822 double getMatrixLinewidthThinFactor();
824 void setMatrixLinewidthThinFactor(
double factor);
826 double getMatrixLinewidthHeavyFactor();
828 void setMatrixLinewidthHeavyFactor(
double factor);
830 double getMatrixLineSeparationFactor();
832 void setMatrixLineSeparationFactor(
double factor);
834 double getMatrixXSeparationFactor();
836 void setMatrixXSeparationFactor(
double factor);
838 double getMatrixYSeparationFactor();
840 void setMatrixYSeparationFactor(
double factor);
842 double getMatrixXPaddingFactor();
844 void setMatrixXPaddingFactor(
double factor);
846 double getMatrixYPaddingFactor();
848 void setMatrixYPaddingFactor(
double factor);
855 QStringList getErrorList() const;
857 bool hadErrors() const;
860 void addToErrorList(const QString& error);
863 void clearErrorList();
875 QStringList error_list;
881 void deleteParsedNode();
886 QMap<QString, QString> fontReplacements;
929 double subsuper_size_factor;
946 double subsuper_mode_selection_by_size_factor;
948 double operatorsubsuper_size_factor;
953 double operatorsubsuper_distance_factor;
958 double operatorsubsuper_extraspace_factor;
971 double intsubsuper_xcorrection_factor;
983 double intsubbesides_xcorrection_xfactor;
991 double mathoperator_width_factor;
995 double bigmathoperator_font_factor;
1000 double super_shift_factor;
1005 double sub_shift_factor;
1011 double special_super_shift_factor;
1017 double special_sub_shift_factor;
1029 double frac_nested_factor;
1034 double frac_shift_factor;
1036 double underbrace_factor;
1038 double underset_factor;
1040 double underbrace_separation_xfactor;
1042 double underbrace_bracesize_xfactor;
1044 double brace_y_shift_factor;
1049 double decoration_height_factor;
1054 double decoration_separation_factor;
1059 double decoration_width_reduction_Xfactor;
1061 double sqrt_smallfont_factor;
1063 double sqrt_width_Xfactor;
1065 double sqrt_height_factor;
1071 double matrix_linewidth_thin_factor;
1076 double matrix_linewidth_heavy_factor;
1081 double matrix_line_separation_factor;
1086 double matrix_xSeparation_factor;
1091 double matrix_ySeparation_factor;
1096 double matrix_xPadding_factor;
1101 double matrix_yPadding_factor;
1104 static QString init_serifFont;
1106 static QString init_sansFont;
1108 static QString init_symbolFont;
1110 static QString init_scriptFont;
1112 static QString init_typewriterFont;
1114 static QString init_caligraphicFont;
1116 static QString init_blackboardFont;
1118 static QString init_fracturFont;
1120 static
bool s_firstStart;
1122 static std::mutex s_mutex;
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
void draw(QPainter &painter, QPointF x, bool drawBoxes=false)
draw a representation to the object at the specified position x , y
bool parse(const QString &markup, ParseOptions options=DefaultParseOptions)
parse the given math markup string, using the given parser class TParser
Definition jkqtmathtext.h:242
bool parse(const QString &markup, DefaultParserTypes markupType=DefaultParser, ParseOptions options=DefaultParseOptions)
parse the given math markup string with a parser derived from markupType.
double draw(QPainter &painter, double x, double y, bool drawBoxes=false)
draw a representation to the object at the specified position x , y
void draw(QPainter &painter, unsigned int flags, QRectF rect, bool drawBoxes=false)
draw into a rectangle rect with alignment defined in flags (see below)
QImage drawIntoImage(bool drawBoxes=false, QColor backgroundColor=QColor(Qt::white), int sizeincrease=0, qreal devicePixelRatio=1.0, unsigned int resolution_dpi=96)
render the last parse result into a QImage
void getSizeDetail(QPainter &painter, double &width, double &ascent, double &descent, double &strikeoutPos)
return the detailes sizes of the text
QPixmap drawIntoPixmap(bool drawBoxes=false, QColor backgroundColor=QColor(Qt::white), int sizeincrease=0, qreal devicePixelRatio=1.0)
render the last parse result into a QPixmap