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

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...

#include <jkqtmathtexttools.h>

Public Member Functions

 JKQTMathTextFontSpecifier ()
 
 JKQTMathTextFontSpecifier (const QString &fontName, const QString &mathFontName)
 
QString fallbackSymbolsFontName () const
 specifies a font to be used for fallbackSymbols
 
QString fontName () const
 specifies the main font name
 
QString getFontSpec () const
 returns the object's constents as a fontSpec string with the form "FONT_NAME[+MATH_FONT_NAME]".
 
bool hasFallbackSymbolFontName () const
 leiefert true, wenn ein fallbcakSymbolsFontName() verfügbar ist
 
bool hasFontName () const
 leiefert true, wenn ein fontName() verfügbar ist
 
bool hasMathFontName () const
 leiefert true, wenn ein mathFontName() verfügbar ist
 
QString mathFontName () const
 specifies the math font to use in addition to fontName
 
void setFallbackSymbolsFontName (const QString &name)
 specifies a font to be used for fallbackSymbols
 
void setFontName (const QString &name)
 specifies the main font name
 
void setFontSpec (const QString &fontSpec)
 initialises the object with values from parsing a fontSpec string as defined in the struct description, see Special Font Names .
 
void setmathFontName (const QString &name)
 specifies the math font to use in addition to fontName
 

Static Public Member Functions

static JKQTMathTextFontSpecifier fromFontSpec (const QString &fontSpec)
 construct a JKQTMathTextFontSpecifier, by parsing a fontSpec string as defined in the struct description, see Special Font Names .
 
static JKQTMathTextFontSpecifier getAppFontFamilies ()
 initialize with the default app font-families for "roman" text and math and tries to find a matching fallback-font. This may be used to initialize serif-fonts
 
static JKQTMathTextFontSpecifier getAppFontSFFamilies ()
 initialize with the default app font-families for "sans-serif" text and math and tries to find a matching fallback-font. This may be used to initialize sans-serif-fonts
 
static JKQTMathTextFontSpecifier getASANAFamilies ()
 initialize with the font-families from the XITS package for text and math
 
static JKQTMathTextFontSpecifier getFIRAFamilies ()
 initialize with the font-families from the Fira (Math) package for text and math
 
static JKQTMathTextFontSpecifier getSTIXFamilies ()
 initialize with the font-families from the STIX package for text and math
 
static JKQTMathTextFontSpecifier getXITSFamilies ()
 initialize with the font-families from the XITS package for text and math
 
static QString transformFontName (const QString &fontName, bool mathmode=false)
 finds actual fonts for some predefined special font names, as listed in Special Font Names
 
static QString transformFontNameAndDecodeSpecialFonts (const QString &fontName, bool mathmode=false)
 same as transformFontName(), but also finds the actual name for XITS, STIX, ASANA,...
 

Private Attributes

QString m_fallbackSymbolFont
 specifies a font to be used for fallbackSymbols
 
QString m_fontName
 specifies the main font name
 
QString m_mathFontName
 specifies the math font to use in addition to fontName
 
bool m_transformOnOutput
 if set true the fonts are transformed when fontname() or mathFontName() is called by calling transformFontNameAndDecodeSpecialFonts()
 

Detailed Description

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)

Font Definition Syntax

JKQTMathTextFontSpecifier::fromFontSpec() defines a special syntax that when parsed allows to seth the font, a math-mode alternative:

  • FONTNAME : set the text-mode font only
  • FONTNAME+MATH_FONTNAME : set the text- and math-mode fonts

Special Font Names

This object also implements replacing special font names with actual fonts. Supported special font names are:

  • default / app / application - the applications default font
  • application-sf - a font for "sans", based on the application font
  • times / serif - a general serif font
  • sans-serif - a general sans-serif font
  • typewriter - a general typewrter/monospaced font
  • cursive
  • decorative
  • fantasy
  • monospace
  • system

If copiled with Qt>5.3 you can also use these:

  • fixed
  • smallest_readable
  • title
  • general

Also some sepcial fonts are defined:

  • xits XITS fonts
  • stix STIX fonts
  • asana ASANA fonts
  • fira Fira fonts

Constructor & Destructor Documentation

◆ JKQTMathTextFontSpecifier() [1/2]

JKQTMathTextFontSpecifier::JKQTMathTextFontSpecifier ( )

◆ JKQTMathTextFontSpecifier() [2/2]

JKQTMathTextFontSpecifier::JKQTMathTextFontSpecifier ( const QString &  fontName,
const QString &  mathFontName 
)

Member Function Documentation

◆ fallbackSymbolsFontName()

QString JKQTMathTextFontSpecifier::fallbackSymbolsFontName ( ) const

specifies a font to be used for fallbackSymbols

◆ fontName()

QString JKQTMathTextFontSpecifier::fontName ( ) const

specifies the main font name

◆ fromFontSpec()

static JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::fromFontSpec ( const QString &  fontSpec)
static

construct a JKQTMathTextFontSpecifier, by parsing a fontSpec string as defined in the struct description, see Special Font Names .

◆ getAppFontFamilies()

static JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getAppFontFamilies ( )
static

initialize with the default app font-families for "roman" text and math and tries to find a matching fallback-font. This may be used to initialize serif-fonts

This method encodes some pre-coded knowledge of suitable combinations of fonts for different systems. e.g. on newer windows systems, the font "Segoe UI" is used for the GUI... a suitable math font with symbols is "Segoe UI Symbol" ...

◆ getAppFontSFFamilies()

static JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getAppFontSFFamilies ( )
static

initialize with the default app font-families for "sans-serif" text and math and tries to find a matching fallback-font. This may be used to initialize sans-serif-fonts

This method encodes some pre-coded knowledge of suitable combinations of fonts for different systems.

This function e.g. checks whether the default app font is sans-serif and then looks for a serif font for the "sans" font class (so the two can be distinguished) and vice-versa.

◆ getASANAFamilies()

static JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getASANAFamilies ( )
static

initialize with the font-families from the XITS package for text and math

◆ getFIRAFamilies()

static JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getFIRAFamilies ( )
static

initialize with the font-families from the Fira (Math) package for text and math

◆ getFontSpec()

QString JKQTMathTextFontSpecifier::getFontSpec ( ) const

returns the object's constents as a fontSpec string with the form "FONT_NAME[+MATH_FONT_NAME]".

◆ getSTIXFamilies()

static JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getSTIXFamilies ( )
static

initialize with the font-families from the STIX package for text and math

◆ getXITSFamilies()

static JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getXITSFamilies ( )
static

initialize with the font-families from the XITS package for text and math

◆ hasFallbackSymbolFontName()

bool JKQTMathTextFontSpecifier::hasFallbackSymbolFontName ( ) const

leiefert true, wenn ein fallbcakSymbolsFontName() verfügbar ist

◆ hasFontName()

bool JKQTMathTextFontSpecifier::hasFontName ( ) const

leiefert true, wenn ein fontName() verfügbar ist

◆ hasMathFontName()

bool JKQTMathTextFontSpecifier::hasMathFontName ( ) const

leiefert true, wenn ein mathFontName() verfügbar ist

◆ mathFontName()

QString JKQTMathTextFontSpecifier::mathFontName ( ) const

specifies the math font to use in addition to fontName

◆ setFallbackSymbolsFontName()

void JKQTMathTextFontSpecifier::setFallbackSymbolsFontName ( const QString &  name)

specifies a font to be used for fallbackSymbols

◆ setFontName()

void JKQTMathTextFontSpecifier::setFontName ( const QString &  name)

specifies the main font name

◆ setFontSpec()

void JKQTMathTextFontSpecifier::setFontSpec ( const QString &  fontSpec)

initialises the object with values from parsing a fontSpec string as defined in the struct description, see Special Font Names .

◆ setmathFontName()

void JKQTMathTextFontSpecifier::setmathFontName ( const QString &  name)

specifies the math font to use in addition to fontName

◆ transformFontName()

static QString JKQTMathTextFontSpecifier::transformFontName ( const QString &  fontName,
bool  mathmode = false 
)
static

finds actual fonts for some predefined special font names, as listed in Special Font Names

◆ transformFontNameAndDecodeSpecialFonts()

static QString JKQTMathTextFontSpecifier::transformFontNameAndDecodeSpecialFonts ( const QString &  fontName,
bool  mathmode = false 
)
static

same as transformFontName(), but also finds the actual name for XITS, STIX, ASANA,...

Member Data Documentation

◆ m_fallbackSymbolFont

QString JKQTMathTextFontSpecifier::m_fallbackSymbolFont
private

specifies a font to be used for fallbackSymbols

◆ m_fontName

QString JKQTMathTextFontSpecifier::m_fontName
private

specifies the main font name

◆ m_mathFontName

QString JKQTMathTextFontSpecifier::m_mathFontName
private

specifies the math font to use in addition to fontName

◆ m_transformOnOutput

bool JKQTMathTextFontSpecifier::m_transformOnOutput
private

if set true the fonts are transformed when fontname() or mathFontName() is called by calling transformFontNameAndDecodeSpecialFonts()


The documentation for this struct was generated from the following file: