diff --git a/doc/images/jkqtmathtext/jkqtmathtext_unicode.png b/doc/images/jkqtmathtext/jkqtmathtext_unicode.png index 3d41561e06b..e10bba73c98 100644 Binary files a/doc/images/jkqtmathtext/jkqtmathtext_unicode.png and b/doc/images/jkqtmathtext/jkqtmathtext_unicode.png differ diff --git a/doc/images/jkqtmathtext/jkqtmathtext_useguifonts.png b/doc/images/jkqtmathtext/jkqtmathtext_useguifonts.png index 269f78fc63c..5031e5e338c 100644 Binary files a/doc/images/jkqtmathtext/jkqtmathtext_useguifonts.png and b/doc/images/jkqtmathtext/jkqtmathtext_useguifonts.png differ diff --git a/doc/images/jkqtmathtext/jkqtmathtext_utf8.png b/doc/images/jkqtmathtext/jkqtmathtext_utf8.png index 59ee5296789..59808b41c77 100644 Binary files a/doc/images/jkqtmathtext/jkqtmathtext_utf8.png and b/doc/images/jkqtmathtext/jkqtmathtext_utf8.png differ diff --git a/examples/jkqtmathtext_test/testform.cpp b/examples/jkqtmathtext_test/testform.cpp index 4c7c6d7d977..9c936ce3a58 100644 --- a/examples/jkqtmathtext_test/testform.cpp +++ b/examples/jkqtmathtext_test/testform.cpp @@ -39,10 +39,18 @@ TestForm::TestForm(QWidget *parent) : " text: & abc123+d/e\\\\\n" " textit: & \\textit{abc123+d/e}\\\\\n" " textbf: & \\textbf{abc123+d/e}\\\\\n" + " textsf: & \\textsf{abc123+d/e}\\\\\n" + " textrm: & \\textrm{abc123+d/e}\\\\\n" + " texttt: & \\texttt{abc123+d/e}\\\\\n" + " textcal: & \\textcal{abc123+d/e}\\\\\n" + " textfrak: & \\textfrak{abc123+d/e}\\\\\n" " math: & $abc123+d/e$\\\\\n" " mathrm: & $\\mathrm{abc123+d/e}$\\\\\n" + " mathsf: & $\\mathsf{abc123+d/e}$\\\\\n" + " mathtt: & $\\mathtt{abc123+d/e}$\\\\\n" " mathit: & $\\mathit{abc123+d/e}$\\\\\n" " mathbf: & $\\mathbf{abc123+d/e}$\\\\\n" + " mathcal: & $\\mathcal{abc123+d/e}$\n" " mathfrak: & $\\mathfrak{abc123+d/e}$\n" "\\end{matrix}"); ui->cmbTestset->addItem("text: umlaute", umla); diff --git a/lib/jkqtmathtext/jkqtmathtexttools.cpp b/lib/jkqtmathtext/jkqtmathtexttools.cpp index 7fb72e97718..1502bad1c3d 100644 --- a/lib/jkqtmathtext/jkqtmathtexttools.cpp +++ b/lib/jkqtmathtext/jkqtmathtexttools.cpp @@ -432,14 +432,14 @@ JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getAppFontFamilies() } } if (!set) { - if (f.styleHint()==QFont::SansSerif) { - const JKQTMathTextFontSpecifier fira=getFIRAFamilies(); - if (fira.hasFallbackSymbolFontName()) fontSpec.m_fallbackSymbolFont=fira.fallbackSymbolsFontName(); - if (fira.hasMathFontName()) fontSpec.m_mathFontName=fira.mathFontName(); - } else { + if (f.styleHint()==QFont::Serif) { const JKQTMathTextFontSpecifier xits=getXITSFamilies(); if (xits.hasFallbackSymbolFontName()) fontSpec.m_fallbackSymbolFont=xits.fallbackSymbolsFontName(); if (xits.hasMathFontName()) fontSpec.m_mathFontName=xits.mathFontName(); + } else { + const JKQTMathTextFontSpecifier fira=getFIRAFamilies(); + if (fira.hasFallbackSymbolFontName()) fontSpec.m_fallbackSymbolFont=fira.fallbackSymbolsFontName(); + if (fira.hasMathFontName()) fontSpec.m_mathFontName=fira.mathFontName(); } } return fontSpec; @@ -450,14 +450,15 @@ JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getAppFontFamilies() JKQTMathTextFontSpecifier JKQTMathTextFontSpecifier::getAppFontSFFamilies() { static JKQTMathTextFontSpecifier fontSpec=[]() -> JKQTMathTextFontSpecifier { + JKQTMathTextFontSpecifier fontSpec; const QFont f=QGuiApplication::font().family(); QFont testFnt; - if (f.styleHint()==QFont::SansSerif) { - testFnt.setStyleHint(QFont::StyleHint::Serif); - fontSpec.m_fontName=fontSpec.m_mathFontName=testFnt.defaultFamily(); - } else { + if (f.styleHint()==QFont::Serif) { testFnt.setStyleHint(QFont::StyleHint::SansSerif); - fontSpec.m_fontName=fontSpec.m_mathFontName=testFnt.defaultFamily(); + fontSpec.m_fontName=fontSpec.m_mathFontName=testFnt.defaultFamily();; + } else { + testFnt.setStyleHint(QFont::StyleHint::Serif); + fontSpec.m_fontName=fontSpec.m_mathFontName=testFnt.defaultFamily();; } return fontSpec; }(); diff --git a/lib/jkqtmathtext/jkqtmathtexttools.h b/lib/jkqtmathtext/jkqtmathtexttools.h index a6418fe0954..5c31b18e2ed 100644 --- a/lib/jkqtmathtext/jkqtmathtexttools.h +++ b/lib/jkqtmathtext/jkqtmathtexttools.h @@ -147,7 +147,7 @@ struct JKQTMATHTEXT_LIB_EXPORT JKQTMathTextFontSpecifier { * font with symbols is "Segoe UI Symbol" ... */ static JKQTMathTextFontSpecifier getAppFontFamilies(); - /** \brief initialize with the default app font-families for "serif" text and math and tries to find a matching fallback-font. This may be used to initialize sans-serif-fonts + /** \brief 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. *