Open RuixiZhang42 opened 5 years ago
Take t1ntxtlf.fd
from the newtx
collection for example, we find the following declarations:
\DeclareFontFamily{T1}{ntxtlf}{\ntx@spacing}
\DeclareFontShape{T1}{ntxtlf}{b}{sc}{<-> \ntx@scaled ntx-Bold-tlf-sc\ntx@lsfx-t1}{}
\DeclareFontShape{T1}{ntxtlf}{b}{n}{<-> \ntx@scaled ntx-Bold-tlf-t1}{}
...
\DeclareFontShape{T1}{ntxtlf}{bx}{sc}{<->ssub * ntxtlf/b/sc}{}
\DeclareFontShape{T1}{ntxtlf}{bx}{n}{<->ssub * ntxtlf/b/n}{}
...
i.e., newtxtext
naturally only has bold. For compatibility reason, e.g., in case other packages do, say, \SetSymbolFont{operators}{bold}{\encodingdefault}{\rmdefault}{bx}{n}
, then it will fall back from the non-existing bold extended to bold.
A different point of view, as mentioned in your comment here, is to move the following code block:
\DeclareSymbolFont{operators}\g_fontspec_encoding_tl\g_@@_mathrm_tl\mddefault\updefault
\SetSymbolFont{operators}{normal}\g_fontspec_encoding_tl\g_@@_mathrm_tl\mddefault\updefault
...
to follow
\bool_if:NT \g_@@_math_bool
{
\@@_info:n {setup-math}
\fontspec_setup_maths:
}
% Add block here:
Thus, the \mathXX
declarations are always executed regardless of the no-math
option.
BTW, in the true branch of \tl_if_empty:NTF \g_@@_bfmathrm_tl
, I think it is still necessary to set up
\SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g_@@_mathrm_tl\bfdefault\updefault % This line may be redundant
\SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g_@@_mathrm_tl\bfdefault\updefault
and in the false branch, the \mddefault
choice is… debatable…
It appears that only a few number of fonts (e.g., Computer Modern) provides the bx
series.
mtpro2
assumes that series b
exists.newtxmath
assumes that either b
or sb
exists. Its text package counterpart substitutes every bx
series with b
(in the .fd
file).lmodern
also substitutes every occurrence of bx
with b
.An excerpt from the documentation: https://github.com/wspr/fontspec/blob/c1fdf6d52c75017656c4d99ca5b4711353da125d/fontspec-doc-fontsel.tex#L486-L487
@wspr Just noticed a large scale of bx -> b
changes in the test files in https://github.com/wspr/fontspec/commit/74c6917a13faa3aef57a68820ebaa222d51e4b42 and https://github.com/wspr/fontspec/commit/1b3596ce63db3ed73592144ffec5e42d17000c59 and https://github.com/wspr/fontspec/commit/19fa825a56c144ad478cc9f42bf2c0ff80e7fd4e. Are these changes coming from the LaTeX2e kernel? I cannot find the code change in fontspec
…
@RuixiZhang42 — yes, that's right, the new default in LaTeX2e will be b
. Sorry for my silence on this issue... I will be adding bx↔︎b substitution some time soon...
Description
The
mtpro2
math package (and also thenewtxmath
math package, etc.) assumes that text font has ab
series. Most traditional text font packages either provide theb
series or make sure that font substitutions fromb
tobx
and vice versa happen. This is not the case withfontspec
.Check/indicate
Minimal example demonstrating the issue
Further details
One of the default font series set by
fontspec
isbx
.bx
is supposed to be “bold extended”, so the naming here is arguably wrong.fontspec
make sure that font substitution betweenb
andbx
happen?