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
|
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() | |
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)
JKQTMathTextFontSpecifier::fromFontSpec() defines a special syntax that when parsed allows to seth the font, a math-mode alternative:
FONTNAME
: set the text-mode font onlyFONTNAME+MATH_FONTNAME
: set the text- and math-mode fontsThis object also implements replacing special font names with actual fonts. Supported special font names are:
default
/ app
/ application
- the applications default fontapplication-sf
- a font for "sans", based on the application fonttimes
/ serif
- a general serif fontsans-serif
- a general sans-serif fonttypewriter
- a general typewrter/monospaced fontcursive
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:
JKQTMathTextFontSpecifier::JKQTMathTextFontSpecifier | ( | ) |
JKQTMathTextFontSpecifier::JKQTMathTextFontSpecifier | ( | const QString & | fontName, |
const QString & | mathFontName | ||
) |
QString JKQTMathTextFontSpecifier::fallbackSymbolsFontName | ( | ) | const |
specifies a font to be used for fallbackSymbols
QString JKQTMathTextFontSpecifier::fontName | ( | ) | const |
specifies the main font name
|
static |
construct a JKQTMathTextFontSpecifier, by parsing a fontSpec string as defined in the struct description, see Special Font Names .
|
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" ...
|
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.
|
static |
initialize with the font-families from the XITS package for text and math
|
static |
initialize with the font-families from the Fira (Math) package for text and math
QString JKQTMathTextFontSpecifier::getFontSpec | ( | ) | const |
returns the object's constents as a fontSpec string with the form "FONT_NAME[+MATH_FONT_NAME]"
.
|
static |
initialize with the font-families from the STIX package for text and math
|
static |
initialize with the font-families from the XITS package for text and math
bool JKQTMathTextFontSpecifier::hasFallbackSymbolFontName | ( | ) | const |
leiefert true
, wenn ein fallbcakSymbolsFontName() verfügbar ist
bool JKQTMathTextFontSpecifier::hasFontName | ( | ) | const |
leiefert true
, wenn ein fontName() verfügbar ist
bool JKQTMathTextFontSpecifier::hasMathFontName | ( | ) | const |
leiefert true
, wenn ein mathFontName() verfügbar ist
QString JKQTMathTextFontSpecifier::mathFontName | ( | ) | const |
specifies the math font to use in addition to fontName
void JKQTMathTextFontSpecifier::setFallbackSymbolsFontName | ( | const QString & | name | ) |
specifies a font to be used for fallbackSymbols
void JKQTMathTextFontSpecifier::setFontName | ( | const QString & | name | ) |
specifies the main font name
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 .
void JKQTMathTextFontSpecifier::setmathFontName | ( | const QString & | name | ) |
specifies the math font to use in addition to fontName
|
static |
finds actual fonts for some predefined special font names, as listed in Special Font Names
|
static |
same as transformFontName(), but also finds the actual name for XITS, STIX, ASANA,...
|
private |
specifies a font to be used for fallbackSymbols
|
private |
specifies the main font name
|
private |
specifies the math font to use in addition to fontName
|
private |
if set true
the fonts are transformed when fontname() or mathFontName() is called by calling transformFontNameAndDecodeSpecialFonts()