diff --git a/TeXmacs/fonts/opentype/Asana-Math.otf b/TeXmacs/fonts/opentype/Asana-Math.otf new file mode 100644 index 0000000000..fb43a86010 Binary files /dev/null and b/TeXmacs/fonts/opentype/Asana-Math.otf differ diff --git a/src/Graphics/Fonts/font.hpp b/src/Graphics/Fonts/font.hpp index 8a675202c1..715951b827 100644 --- a/src/Graphics/Fonts/font.hpp +++ b/src/Graphics/Fonts/font.hpp @@ -232,8 +232,12 @@ font math_font (scheme_tree t, font base_fn, font error_fn, double zoomx, font compound_font (scheme_tree def, double zoomx, double zoomy); font smart_font (string family, string variant, string series, string shape, int sz, int dpi); -font smart_font (string family, string variant, string series, string shape, - string tf, string tv, string tw, string ts, int sz, int dpi); +font math_smart_font (string family, string variant, string series, + string shape, string tf, string tv, string tw, string ts, + int sz, int dpi); +font prog_smart_font (string family, string variant, string series, + string shape, string tf, string tv, string tw, string ts, + int sz, int dpi); font apply_effects (font fn, string effects); int script (int sz, int level); diff --git a/src/Graphics/Fonts/smart_font.cpp b/src/Graphics/Fonts/smart_font.cpp index a879b369d2..c45445740e 100644 --- a/src/Graphics/Fonts/smart_font.cpp +++ b/src/Graphics/Fonts/smart_font.cpp @@ -1709,9 +1709,9 @@ smart_font (string family, string variant, string series, string shape, int sz, } font -smart_font (string family, string variant, string series, string shape, - string tfam, string tvar, string tser, string tsh, int sz, - int dpi) { +math_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; } @@ -1723,6 +1723,16 @@ smart_font (string family, string variant, string series, string shape, return smart_font (tfam, tvar, tser, tsh, sz, dpi); } +font +prog_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; + } + return smart_font (tfam, tvar, tser, tsh, sz, dpi); +} + static string get_string_parameter (string val, int i, string def) { array a= trimmed_tokenize (val, ";"); diff --git a/src/Typeset/Env/env_semantics.cpp b/src/Typeset/Env/env_semantics.cpp index 70604f2522..deb12821a0 100644 --- a/src/Typeset/Env/env_semantics.cpp +++ b/src/Typeset/Env/env_semantics.cpp @@ -546,18 +546,20 @@ edit_env_rep::update_font () { get_script_size (fn_size, index_level), (int) (magn * dpi)); break; case 2: - fn= smart_font (get_string (MATH_FONT), get_string (MATH_FONT_FAMILY), - get_string (MATH_FONT_SERIES), get_string (MATH_FONT_SHAPE), - get_string (FONT), get_string (FONT_FAMILY), - get_string (FONT_SERIES), "mathitalic", - get_script_size (fn_size, index_level), (int) (magn * dpi)); + fn= math_smart_font (get_string (MATH_FONT), get_string (MATH_FONT_FAMILY), + get_string (MATH_FONT_SERIES), + get_string (MATH_FONT_SHAPE), get_string (FONT), + get_string (FONT_FAMILY), get_string (FONT_SERIES), + "mathitalic", get_script_size (fn_size, index_level), + (int) (magn * dpi)); break; case 3: - fn= smart_font (get_string (PROG_FONT), get_string (PROG_FONT_FAMILY), - get_string (PROG_FONT_SERIES), get_string (PROG_FONT_SHAPE), - get_string (FONT), get_string (FONT_FAMILY) * "-tt", - get_string (FONT_SERIES), get_string (FONT_SHAPE), - get_script_size (fn_size, index_level), (int) (magn * dpi)); + fn= prog_smart_font ( + get_string (PROG_FONT), get_string (PROG_FONT_FAMILY), + get_string (PROG_FONT_SERIES), get_string (PROG_FONT_SHAPE), + get_string (FONT), get_string (FONT_FAMILY) * "-tt", + get_string (FONT_SERIES), get_string (FONT_SHAPE), + get_script_size (fn_size, index_level), (int) (magn * dpi)); break; } string eff= get_string (FONT_EFFECTS);