JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
Collaboration diagram for Tool Functions and Types for JKQTMathText:

Classes

struct  JKQTMathTextEnvironment
 describes the current drawing environment (base fontname ...) More...
 
struct  JKQTMathTextFontDefinition
 summarizes all information available on a font for a specific MTenvironmentFont More...
 
struct  JKQTMathTextFontSpecifier
 represents a font specifier for JKQTMathText. The font consists of two parts: the actual font and the font used for math output (which may be empty) More...
 
struct  JKQTMathTextNodeSize
 beschreibt die Größe(n) eines Knotens More...
 

Enumerations

enum  JKQTMathTextBlackboradDrawingMode {
  MTBBDMfontDirectly =0 ,
  MTBBDMsimulate ,
  MTBBDMunicodeCharactersOrFontDirectly ,
  MTBBDMunicodeCharactersOrSimulate ,
  MTBBDMdefault =MTBBDMunicodeCharactersOrFontDirectly
}
 used to specify how blackboard-fonts are drawn More...
 
enum  JKQTMathTextBraceType {
  MTBTParenthesis =0 ,
  MTBTSquareBracket ,
  MTBTCurlyBracket ,
  MTBTAngleBracket ,
  MTBTCeilBracket ,
  MTBTFloorBracket ,
  MTBTDoubleLine ,
  MTBTSingleLine ,
  MTBTTopCorner ,
  MTBTBottomCorner ,
  MTBTNone ,
  MTBTAny ,
  MTBTUnknown
}
 types of available braces More...
 
enum  JKQTMathTextEnvironmentFont {
  MTEroman ,
  MTEsans ,
  MTEmathRoman ,
  MTEmathSans ,
  MTEtypewriter ,
  MTEscript ,
  MTEblackboard ,
  MTEcaligraphic ,
  MTEfraktur ,
  MTEFallbackSymbols ,
  MTECurrentFont ,
  MTECustomFont
}
 the available logical fonts (default is MTEroman) More...
 
enum  JKQTMathTextFontEncoding {
  MTFEWinSymbol =0 ,
  MTFEUnicode =1 ,
  MTFELatin1 =2 ,
  MTFEStandard =MTFELatin1
}
 used to specify the font encoding used for drawing More...
 
enum  JKQTMathTextHorizontalAlignment {
  MTHALeft ,
  MTHACentered ,
  MTHARight
}
 types of horizontal alignment More...
 
enum  JKQTMathTextVerticalOrientation {
  MTVOTop ,
  MTVOFirstLine ,
  MTVOCentered ,
  MTVOLastLine ,
  MTVOBottom
}
 type of ffractions represented by JKQTMathTextFracNode More...
 

Functions

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextFontEncoding estimateJKQTMathTextFontEncoding (QFont font)
 this function tries to determine the JKQTMathTextFontEncoding of a given font (HEURISTICS!!!)
 
JKQTMATHTEXT_LIB_EXPORT void initJKQTMathTextResources ()
 initialized Qt-ressources necessary for JKQTMathText
 
JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBraceType InstructionName2JKQTMathTextBraceType (const QString &tokenName)
 convert a string tokenName describing a LaTeX Instruction into an opening or closing JKQTMathTextBraceType
 
JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBraceType InstructionName2OpeningJKQTMathTextBraceType (const QString &tokenName)
 convert a string tokenName describing a LaTeX Instruction into an opening JKQTMathTextBraceType
 
JKQTMATHTEXT_LIB_EXPORT bool InstructionNameMatchesJKQTMathTextBraceType (const QString &token, JKQTMathTextBraceType type, bool acceptMTBTNone, bool *tokenEqualsNone=nullptr)
 returns true, if the given instruction-Name token ("|", "{", ..., "lceil", ".", ...) matches the given type (returns true, when type == MTBTAny )
 
JKQTMATHTEXT_LIB_EXPORT bool isPrintableJKQTMathTextBraceType (JKQTMathTextBraceType type)
 return true if type represents a printable type of brace (including MTBTNone), basically true for any JKQTMathTextBraceType that can be used as parameter to JKQTMathTextBraceNode
 
JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextBlackboradDrawingMode2String (JKQTMathTextBlackboradDrawingMode mode)
 this converts a JKQTMathTextBlackboradDrawingMode into a string
 
JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextBraceType2String (JKQTMathTextBraceType type)
 convert a JKQTMathTextBraceType into a string
 
JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextFontEncoding2String (JKQTMathTextFontEncoding e)
 convert MTfontEncoding to a string
 
JKQTMATHTEXT_LIB_EXPORT QRectF JKQTMathTextGetBoundingRect (const QFont &fm, const QString &text, QPaintDevice *pd)
 calculates the bounding rectangle around text (from (using QFontMetricsF::boundingRect()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontAscent (const QFont &fm, QPaintDevice *pd)
 calculates the ascent of font (from QFontMetricsF::ascent()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontDescent (const QFont &fm, QPaintDevice *pd)
 calculates the descent of font (from QFontMetricsF::descent()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontHeight (const QFont &fm, QPaintDevice *pd)
 calculates the height of font (from QFontMetricsF::height()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontLeading (const QFont &fm, QPaintDevice *pd)
 calculates the leading of font (from QFontMetricsF::leading()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontLineSpacing (const QFont &fm, QPaintDevice *pd)
 calculates the line spacing of font (from QFontMetricsF::lineSpacing()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontLineWidth (const QFont &fm, QPaintDevice *pd)
 calculates the line width of font (from QFontMetricsF::lineWidth()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontStrikoutPos (const QFont &fm, QPaintDevice *pd)
 calculates the strikeout-pos of font (from QFontMetricsF::strikeoutPos()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetHorAdvance (const QFont &fm, const QString &text, QPaintDevice *pd)
 calculates the horizontal advance of text (from QFontMetricsF::horizontalAdvance() or QFontMetricsF::width() if it is not yet available in your Qt version), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetLeftBearing (const QFont &fm, const QChar &text, QPaintDevice *pd)
 calculates the left bearing of text (from QFontMetricsF::leftBearing()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT QFont JKQTMathTextGetNonItalic (const QFont &f)
 returns a copy of f, but with the italic-property set to false
 
JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetRightBearing (const QFont &fm, const QChar &text, QPaintDevice *pd)
 calculates the right bearing of text (from QFontMetricsF::rightBearing()), uses internal hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT QRectF JKQTMathTextGetTightBoundingRect (const QFont &fm, const QString &text, QPaintDevice *pd)
 calculates the tight bounding rectangle around text (from QFontMetricsF::tightBoundingRect()), uses internal (thread-local) hashing to not redo a calculation that has already been performed
 
JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextHorizontalAlignment2String (JKQTMathTextHorizontalAlignment type)
 convert a JKQTMathTextHorizontalAlignment into a string
 
JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextLineSpacingMode2String (JKQTMathTextLineSpacingMode mode)
 convert a SpacingMode to a String
 
JKQTMATHTEXT_LIB_EXPORT QPainterPath JKQTMathTextMakeArrow (double x, double y, double width, double arrowW, bool left=false, bool right=true)
 create a QPainterPath for drawing horizontal arrows
 
JKQTMATHTEXT_LIB_EXPORT QPainterPath JKQTMathTextMakeDArrow (double x, double y, double width, double arrowW, bool left=false, bool right=true)
 create a QPainterPath for drawing horizontal double arrows
 
JKQTMATHTEXT_LIB_EXPORT QPainterPath JKQTMathTextMakeHBracePath (double x, double ybrace, double width, double bw, double lineWidth, double cubicshrink=0.5, double cubiccontrolfac=0.3, double lineWidthShrinkFactor=0.6, double lineWidthGrowFactor=0.9)
 create a QPainterPath for drawing horizontal braces, use QPainter::fillPath() with a vanishing line-width to draw this
 
JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextVerticalOrientation2String (JKQTMathTextVerticalOrientation mode)
 convert a JKQTMathTextVerticalOrientation into a QString
 
JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBlackboradDrawingMode String2JKQTMathTextBlackboradDrawingMode (QString mode)
 this converts a QString into a JKQTMathTextBlackboradDrawingMode
 
JKQTMATHTEXT_LIB_EXPORT JKQTMathTextHorizontalAlignment String2JKQTMathTextHorizontalAlignment (QString tokenName)
 convert a string tokenName into a JKQTMathTextHorizontalAlignment
 
JKQTMATHTEXT_LIB_EXPORT JKQTMathTextLineSpacingMode String2JKQTMathTextLineSpacingMode (QString mode)
 convert a String to a SpacingMode
 
JKQTMATHTEXT_LIB_EXPORT JKQTMathTextVerticalOrientation String2JKQTMathTextVerticalOrientation (QString mode)
 returns the JKQTMathTextVerticalOrientation corresponding to instructionName
 
JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBraceType TokenName2JKQTMathTextBraceType (const QString &tokenName, bool *isOpening=nullptr)
 convert a string tokenName describing a LaTeX Token or Instruction into an opening or closing JKQTMathTextBraceType
 
JKQTMATHTEXT_LIB_EXPORT bool TokenNameMatchesJKQTMathTextBraceType (const QString &token, JKQTMathTextBraceType type, bool acceptMTBTNone, bool *tokenEqualsNone=nullptr)
 returns true, if the given token/instruction-Name token ("{", "(", ..., "lceil", ".", ...) matches the given type (returns true, when type == MTBTAny )
 

Detailed Description

Enumeration Type Documentation

◆ JKQTMathTextBlackboradDrawingMode

used to specify how blackboard-fonts are drawn

See also
JKQTMathTextBlackboradDrawingMode2String(), String2JKQTMathTextBlackboradDrawingMode()
Enumerator
MTBBDMfontDirectly 

draw using the font specified by JKQTMathText::setFontBlackboard()

MTBBDMsimulate 

simulate a blackboard font (i.e. draw the characters' outline only), based on the font specified by JKQTMathText::setFontBlackboard() (e.g. Arial or another sans-serif font is a good choice)

MTBBDMunicodeCharactersOrFontDirectly 

use the currently set font and look for special unicode-characters in it, uses the fallbackSymbolFont as fallback, use MTBBDMfontDirectly for characters that are not available

MTBBDMunicodeCharactersOrSimulate 

use the currently set font and look for special unicode-characters in it, uses the fallbackSymbolFont as fallback, use MTBBDMsimulate for characters that are not available

br

MTBBDMdefault 

default drawing mode, same as MTBBDMunicodeCharactersOrFontDirectly

◆ JKQTMathTextBraceType

types of available braces

Enumerator
MTBTParenthesis 

parantheses ()

MTBTSquareBracket 

brackets []

MTBTCurlyBracket 

curly braces {}

MTBTAngleBracket 

angle backets <>

MTBTCeilBracket 

ceil brackets

MTBTFloorBracket 

floor brackets

MTBTDoubleLine 

double-line brackets (norm ||...||)

MTBTSingleLine 

single-line brackets (abs |...|)

MTBTTopCorner 

top-corner brackets

MTBTBottomCorner 

bottom-corner brackets

MTBTNone 

no bracket

MTBTAny 

any bracket, used by JKQTMathText::parseLatexString()

MTBTUnknown 

an unknown tokenName presented to TokenName2JKQTMathTextBraceType()

◆ JKQTMathTextEnvironmentFont

the available logical fonts (default is MTEroman)

Enumerator
MTEroman 

roman font, e.g. \rm{}

MTEsans 

sans-serif font, e.g. \sf{}

MTEmathRoman 

math-mode roman font, e.g. \mathrm{}

MTEmathSans 

math-mode sans-serif font, e.g. \mathsf{}

MTEtypewriter 

typewriter font, e.g. \tt{},\mathtt{}

MTEscript 

script font, e.g. \script{},\mathscript{}

MTEblackboard 

blackboard font, e.g. \mathbb{}

MTEcaligraphic 

caligraphic font, e.g. \mathcal{}

MTEfraktur 

fraktur font, e.g. \mathfrak{}

MTEFallbackSymbols 

symbol font

MTECurrentFont 

internal enum value that specifies that the currently set font shall be used

MTECustomFont 

internal enum value that specifies that a custom font specified elsewhere shall be used

◆ JKQTMathTextFontEncoding

used to specify the font encoding used for drawing

Enumerator
MTFEWinSymbol 

This assumes that symbols shall be taken from a MS Windows style Symbol font.

MTFEUnicode 

This assumes that symbols shall be taken from a Unicode font, which ideally offers full symbol support (e.g. the XITS fonts, STIX fonts from http://www.stixfonts.org/)

MTFELatin1 

the encoding of a standard Latin1 TTF font (i.e. we can only expect letters,number and not many special characters)

MTFEStandard 

◆ JKQTMathTextHorizontalAlignment

types of horizontal alignment

See also
JKQTMathTextVerticalOrientation2String(), String2JKQTMathTextVerticalOrientation(), JKQTMathTextVerticalListNode
Enumerator
MTHALeft 

align left

MTHACentered 

align centered

MTHARight 

align right

◆ JKQTMathTextVerticalOrientation

type of ffractions represented by JKQTMathTextFracNode

See also
JKQTMathTextVerticalOrientation2String(), String2JKQTMathTextVerticalOrientation(), JKQTMathTextVerticalListNode, JKQTMathTextVerbatimNode
Enumerator
MTVOTop 

baseline of the whole block is at the top of the first

MTVOFirstLine 

baseline of the whole block is at the baseline of the first line

MTVOCentered 

baseline of the whole block is at the center of all lines

MTVOLastLine 

baseline of the whole block is at the baseline of the last line

MTVOBottom 

baseline of the whole block is at the bottom of the last line

Function Documentation

◆ estimateJKQTMathTextFontEncoding()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextFontEncoding estimateJKQTMathTextFontEncoding ( QFont  font)

this function tries to determine the JKQTMathTextFontEncoding of a given font (HEURISTICS!!!)

◆ initJKQTMathTextResources()

JKQTMATHTEXT_LIB_EXPORT void initJKQTMathTextResources ( )

initialized Qt-ressources necessary for JKQTMathText

◆ InstructionName2JKQTMathTextBraceType()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBraceType InstructionName2JKQTMathTextBraceType ( const QString &  tokenName)

convert a string tokenName describing a LaTeX Instruction into an opening or closing JKQTMathTextBraceType

This returns a JKQTMathTextBraceType for which isPrintableJKQTMathTextBraceType() is true, or MTBTUnknown, never MTBTNone or MTBTAny.

◆ InstructionName2OpeningJKQTMathTextBraceType()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBraceType InstructionName2OpeningJKQTMathTextBraceType ( const QString &  tokenName)

convert a string tokenName describing a LaTeX Instruction into an opening JKQTMathTextBraceType

This returns a JKQTMathTextBraceType for which isPrintableJKQTMathTextBraceType() is true, or MTBTUnknown, never MTBTNone or MTBTAny.

◆ InstructionNameMatchesJKQTMathTextBraceType()

JKQTMATHTEXT_LIB_EXPORT bool InstructionNameMatchesJKQTMathTextBraceType ( const QString &  token,
JKQTMathTextBraceType  type,
bool  acceptMTBTNone,
bool *  tokenEqualsNone = nullptr 
)

returns true, if the given instruction-Name token ("|", "{", ..., "lceil", ".", ...) matches the given type (returns true, when type == MTBTAny )

This accepts TokenName2JKQTMathTextBraceType(toke)==MTBTNone for any type, iff acceptMTBTNone ==true.

Optionally returns in tokenEqualsNone whether token was encoding for MTBTNone .

◆ isPrintableJKQTMathTextBraceType()

JKQTMATHTEXT_LIB_EXPORT bool isPrintableJKQTMathTextBraceType ( JKQTMathTextBraceType  type)

return true if type represents a printable type of brace (including MTBTNone), basically true for any JKQTMathTextBraceType that can be used as parameter to JKQTMathTextBraceNode

◆ JKQTMathTextBlackboradDrawingMode2String()

JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextBlackboradDrawingMode2String ( JKQTMathTextBlackboradDrawingMode  mode)

this converts a JKQTMathTextBlackboradDrawingMode into a string

See also
String2JKQTMathTextBlackboradDrawingMode(), JKQTMathTextBlackboradDrawingMode

◆ JKQTMathTextBraceType2String()

JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextBraceType2String ( JKQTMathTextBraceType  type)

convert a JKQTMathTextBraceType into a string

◆ JKQTMathTextFontEncoding2String()

JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextFontEncoding2String ( JKQTMathTextFontEncoding  e)

convert MTfontEncoding to a string

◆ JKQTMathTextGetBoundingRect()

JKQTMATHTEXT_LIB_EXPORT QRectF JKQTMathTextGetBoundingRect ( const QFont &  fm,
const QString &  text,
QPaintDevice *  pd 
)

calculates the bounding rectangle around text (from (using QFontMetricsF::boundingRect()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont the text should be set in
textthe text of which the properties are calculated
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetFontAscent()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontAscent ( const QFont &  fm,
QPaintDevice *  pd 
)

calculates the ascent of font (from QFontMetricsF::ascent()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont for which to calculate
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetFontDescent()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontDescent ( const QFont &  fm,
QPaintDevice *  pd 
)

calculates the descent of font (from QFontMetricsF::descent()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont for which to calculate
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetFontHeight()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontHeight ( const QFont &  fm,
QPaintDevice *  pd 
)

calculates the height of font (from QFontMetricsF::height()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont for which to calculate
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetFontLeading()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontLeading ( const QFont &  fm,
QPaintDevice *  pd 
)

calculates the leading of font (from QFontMetricsF::leading()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont for which to calculate
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetFontLineSpacing()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontLineSpacing ( const QFont &  fm,
QPaintDevice *  pd 
)

calculates the line spacing of font (from QFontMetricsF::lineSpacing()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont for which to calculate
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetFontLineWidth()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontLineWidth ( const QFont &  fm,
QPaintDevice *  pd 
)

calculates the line width of font (from QFontMetricsF::lineWidth()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont for which to calculate
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetFontStrikoutPos()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetFontStrikoutPos ( const QFont &  fm,
QPaintDevice *  pd 
)

calculates the strikeout-pos of font (from QFontMetricsF::strikeoutPos()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont for which to calculate
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetHorAdvance()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetHorAdvance ( const QFont &  fm,
const QString &  text,
QPaintDevice *  pd 
)

calculates the horizontal advance of text (from QFontMetricsF::horizontalAdvance() or QFontMetricsF::width() if it is not yet available in your Qt version), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont the text should be set in
textthe text of which the properties are calculated
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetLeftBearing()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetLeftBearing ( const QFont &  fm,
const QChar &  text,
QPaintDevice *  pd 
)

calculates the left bearing of text (from QFontMetricsF::leftBearing()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont the text should be set in
textthe character of which the properties are calculated
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetNonItalic()

JKQTMATHTEXT_LIB_EXPORT QFont JKQTMathTextGetNonItalic ( const QFont &  f)

returns a copy of f, but with the italic-property set to false

◆ JKQTMathTextGetRightBearing()

JKQTMATHTEXT_LIB_EXPORT qreal JKQTMathTextGetRightBearing ( const QFont &  fm,
const QChar &  text,
QPaintDevice *  pd 
)

calculates the right bearing of text (from QFontMetricsF::rightBearing()), uses internal hashing to not redo a calculation that has already been performed

Parameters
fmfont the text should be set in
textthe character of which the properties are calculated
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextGetTightBoundingRect()

JKQTMATHTEXT_LIB_EXPORT QRectF JKQTMathTextGetTightBoundingRect ( const QFont &  fm,
const QString &  text,
QPaintDevice *  pd 
)

calculates the tight bounding rectangle around text (from QFontMetricsF::tightBoundingRect()), uses internal (thread-local) hashing to not redo a calculation that has already been performed

Parameters
fmfont the text should be set in
textthe text of which the properties are calculated
pd(or nullptr) the currently used QPaintDevice (e.g. from QPainter::device() )
Note
This function is thread-safe and uses the same cache for all threads (so they profit from eachother)

◆ JKQTMathTextHorizontalAlignment2String()

JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextHorizontalAlignment2String ( JKQTMathTextHorizontalAlignment  type)

convert a JKQTMathTextHorizontalAlignment into a string

◆ JKQTMathTextLineSpacingMode2String()

JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextLineSpacingMode2String ( JKQTMathTextLineSpacingMode  mode)

◆ JKQTMathTextMakeArrow()

JKQTMATHTEXT_LIB_EXPORT QPainterPath JKQTMathTextMakeArrow ( double  x,
double  y,
double  width,
double  arrowW,
bool  left = false,
bool  right = true 
)

create a QPainterPath for drawing horizontal arrows

◆ JKQTMathTextMakeDArrow()

JKQTMATHTEXT_LIB_EXPORT QPainterPath JKQTMathTextMakeDArrow ( double  x,
double  y,
double  width,
double  arrowW,
bool  left = false,
bool  right = true 
)

create a QPainterPath for drawing horizontal double arrows

◆ JKQTMathTextMakeHBracePath()

JKQTMATHTEXT_LIB_EXPORT QPainterPath JKQTMathTextMakeHBracePath ( double  x,
double  ybrace,
double  width,
double  bw,
double  lineWidth,
double  cubicshrink = 0.5,
double  cubiccontrolfac = 0.3,
double  lineWidthShrinkFactor = 0.6,
double  lineWidthGrowFactor = 0.9 
)

create a QPainterPath for drawing horizontal braces, use QPainter::fillPath() with a vanishing line-width to draw this

Parameters
xx-center-position of the brace
ybracey-center-position of the brace
widthwith of the overall brace
bwheight of the brace
lineWidthlinewidth when drawing, used for correcting so the brace exactly fills the rectangle and not overshoots it
cubicshrink
cubiccontrolfac
lineWidthShrinkFactorthe width of the tips is lineWidth reduced by this factor
lineWidthGrowFactorthe width of the horizontal bars is increased by this factor from lineWidth

◆ JKQTMathTextVerticalOrientation2String()

JKQTMATHTEXT_LIB_EXPORT QString JKQTMathTextVerticalOrientation2String ( JKQTMathTextVerticalOrientation  mode)

◆ String2JKQTMathTextBlackboradDrawingMode()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBlackboradDrawingMode String2JKQTMathTextBlackboradDrawingMode ( QString  mode)

this converts a QString into a JKQTMathTextBlackboradDrawingMode

See also
JKQTMathTextBlackboradDrawingMode2String(), JKQTMathTextBlackboradDrawingMode

◆ String2JKQTMathTextHorizontalAlignment()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextHorizontalAlignment String2JKQTMathTextHorizontalAlignment ( QString  tokenName)

convert a string tokenName into a JKQTMathTextHorizontalAlignment

◆ String2JKQTMathTextLineSpacingMode()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextLineSpacingMode String2JKQTMathTextLineSpacingMode ( QString  mode)

◆ String2JKQTMathTextVerticalOrientation()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextVerticalOrientation String2JKQTMathTextVerticalOrientation ( QString  mode)

returns the JKQTMathTextVerticalOrientation corresponding to instructionName

See also
JKQTMathTextVerticalOrientation2String(), String2JKQTMathTextVerticalOrientation(), JKQTMathTextVerticalListNode, JKQTMathTextVerbatimNode

◆ TokenName2JKQTMathTextBraceType()

JKQTMATHTEXT_LIB_EXPORT JKQTMathTextBraceType TokenName2JKQTMathTextBraceType ( const QString &  tokenName,
bool *  isOpening = nullptr 
)

convert a string tokenName describing a LaTeX Token or Instruction into an opening or closing JKQTMathTextBraceType

◆ TokenNameMatchesJKQTMathTextBraceType()

JKQTMATHTEXT_LIB_EXPORT bool TokenNameMatchesJKQTMathTextBraceType ( const QString &  token,
JKQTMathTextBraceType  type,
bool  acceptMTBTNone,
bool *  tokenEqualsNone = nullptr 
)

returns true, if the given token/instruction-Name token ("{", "(", ..., "lceil", ".", ...) matches the given type (returns true, when type == MTBTAny )

This accepts TokenName2JKQTMathTextBraceType(toke)==MTBTNone for any type, iff acceptMTBTNone ==true.

Optionally returns in tokenEqualsNone whether token was encoding for MTBTNone .