Skip to content

Commit

Permalink
Set bold math version by default
Browse files Browse the repository at this point in the history
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
khaledhosny committed May 13, 2012
1 parent e6ceebe commit 6c0f46b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
9 changes: 9 additions & 0 deletions 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}
25 changes: 24 additions & 1 deletion unicode-math.dtx
Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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-} ,
Expand Down

0 comments on commit 6c0f46b

Please sign in to comment.