Skip to content

Commit

Permalink
[80_1] Font: choose the correct math font in math mode part2
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Nov 1, 2024
1 parent 796700b commit 913f4ea
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
17 changes: 17 additions & 0 deletions TeXmacs/tests/tmu/80_9_math_font.tmu
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<TMU|<tuple|1.0.5|1.2.9.5>>

<style|<tuple|generic|chinese>>

<\body>
<\equation*>
a+b
</equation*>
</body>

<\initial>
<\collection>
<associate|math-font|Stix Math>
<associate|page-medium|paper>
<associate|page-screen-margin|false>
</collection>
</initial>
5 changes: 4 additions & 1 deletion src/Graphics/Fonts/smart_font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1707,12 +1707,15 @@ font
smart_font (string family, string variant, string series, string shape,
string tfam, string tvar, string tser, string tsh, int sz,
int dpi) {
if (tfam == "roman" || starts (tfam, "sys-")) {
tfam= family;
}
if (variant != "mr") {
if (variant == "ms") tvar= "ss";
if (variant == "mt") tvar= "tt";
}
if (shape == "right") tsh= "mathupright";
return smart_font (family, tvar, tser, tsh, sz, dpi);
return smart_font (tfam, tvar, tser, tsh, sz, dpi);
}

static string
Expand Down

0 comments on commit 913f4ea

Please sign in to comment.