Skip to content

Commit

Permalink
[80_1] Font: choose the correct math font in math mode
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii committed Nov 1, 2024
1 parent 4c6d2c3 commit 2832457
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
14 changes: 14 additions & 0 deletions TeXmacs/tests/tmu/80_1.tmu
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<TMU|<tuple|1.0.5|1.2.9.5>>

<style|<tuple|generic|chinese>>

<\body>
<math|<around*|(|a+b|)>>
</body>

<\initial>
<\collection>
<associate|math-font|math-stix>
<associate|page-screen-margin|false>
</collection>
</initial>
9 changes: 4 additions & 5 deletions src/Graphics/Fonts/smart_font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,15 +1657,15 @@ smart_font_bis (string family, string variant, string series, string shape,
if (starts (family, "sys-")) {
if (family == "sys-chinese") {
string name= default_chinese_font_name ();
family = "math=roman,cjk=" * name * ",roman";
family = "cjk=" * name * ",roman";
}
if (family == "sys-japanese") {
string name= default_japanese_font_name ();
family = "math=roman,cjk=" * name * ",roman";
family = "cjk=" * name * ",roman";
}
if (family == "sys-korean") {
string name= default_korean_font_name ();
family = "math=roman,cjk=" * name * ",roman";
family = "cjk=" * name * ",roman";
}
}
family= tex_gyre_fix (family, series, shape);
Expand Down Expand Up @@ -1707,13 +1707,12 @@ 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") tfam= family;
if (variant != "mr") {
if (variant == "ms") tvar= "ss";
if (variant == "mt") tvar= "tt";
}
if (shape == "right") tsh= "mathupright";
return smart_font (tfam, tvar, tser, tsh, sz, dpi);
return smart_font (family, tvar, tser, tsh, sz, dpi);
}

static string
Expand Down

0 comments on commit 2832457

Please sign in to comment.