Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set bold math version by default

Set bold math version, if the math font has a bold variant it will be
used, else LaTeX will fallback to normal font, but now gives LaTeX font
warnings since almost all fonts lack a bold variant, not sure how to
suppress it.

fixes #229 and fixes 230
  • Loading branch information...
commit 6c0f46b4ba6530202bf0ab42e0c3a61729712659 1 parent e6ceebe
@khaledhosny khaledhosny authored
Showing with 33 additions and 1 deletion.
  1. +9 −0 testfiles/F-boldmath.ltx
  2. +24 −1 unicode-math.dtx
View
9 testfiles/F-boldmath.ltx
@@ -0,0 +1,9 @@
+\input{umtest-preamble}
+\usepackage{unicode-math}
+\setmathfont{Lucida Bright Math OT}
+\begin{document}
+\begin{tabular}{lr}
+normal & $a+b=c$ \\
+bold & \boldmath $a+b=c$ \\
+\end{tabular}
+\end{document}
View
25 unicode-math.dtx
@@ -2432,6 +2432,15 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria
\SetSymbolFont{\um_symfont_tl}{\l_um_mversion_tl}
{\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault}
% \end{macrocode}
+% Set the bold math version.
+% \begin{macrocode}
+ \tl_set:Nn \l_um_tmpa_tl {normal}
+ \tl_if_eq:NNT \l_um_mversion_tl \l_um_tmpa_tl
+ {
+ \SetSymbolFont{\um_symfont_tl}{bold}
+ {\encodingdefault}{\l_um_family_tl}{\bfdefault}{\updefault}
+ }
+% \end{macrocode}
% Declare the math sizes (i.e., scaling of superscripts) for the specific
% values for this font,
% and set defaults for math fams two and three for legacy compatibility:
@@ -2516,6 +2525,13 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria
} {\l_um_fontname_tl}
\SetSymbolFont{symbols}{\l_um_mversion_tl}
{\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault}
+
+ \tl_set:Nn \l_um_tmpa_tl {normal}
+ \tl_if_eq:NNT \l_um_mversion_tl \l_um_tmpa_tl
+ {
+ \SetSymbolFont{symbols}{bold}
+ {\encodingdefault}{\l_um_family_tl}{\bfdefault}{\updefault}
+ }
}
% \end{macrocode}
% \end{macro}
@@ -2539,6 +2555,13 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria
} {\l_um_fontname_tl}
\SetSymbolFont{largesymbols}{\l_um_mversion_tl}
{\encodingdefault}{\l_um_family_tl}{\mddefault}{\updefault}
+
+ \tl_set:Nn \l_um_tmpa_tl {normal}
+ \tl_if_eq:NNT \l_um_mversion_tl \l_um_tmpa_tl
+ {
+ \SetSymbolFont{largesymbols}{bold}
+ {\encodingdefault}{\l_um_family_tl}{\bfdefault}{\updefault}
+ }
}
% \end{macrocode}
% \end{macro}
@@ -2562,7 +2585,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria
\cs_new:Nn \um_fontspec_select_font: {
\tl_set:Nx \l_um_font_keyval_tl {
%<LU> Renderer = Basic,
- BoldFont = {}, ItalicFont = {},
+ BoldItalicFont = {}, ItalicFont = {},
Script = Math,
SizeFeatures = {
{Size = \tf@size-} ,

0 comments on commit 6c0f46b

Please sign in to comment.
Something went wrong with that request. Please try again.