Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\sffamily after \fontseriesforce + \selectfont #579

Closed
aminophen opened this issue Jun 4, 2021 · 3 comments
Closed

\sffamily after \fontseriesforce + \selectfont #579

aminophen opened this issue Jun 4, 2021 · 3 comments

Comments

@aminophen
Copy link
Contributor

aminophen commented Jun 4, 2021

Brief outline of the bug

The behavior of \sffamily changed after \fontseriesforce{something}\selectfont, between 2020-10-01 and 2021-06-01. Maybe related to #444 but I don't know whether this is an intended change.

Minimal example showing the bug

%#!pdflatex
\RequirePackage{latexbug}
%\RequirePackage[2020/10/01]{latexrelease}
\documentclass{article}
\makeatletter
\DeclareFontFamily{OT1}{hoge}{}
\DeclareFontShape {OT1}{hoge}{m} {n}{<-> s*cmff10}{}
\DeclareFontShape {OT1}{hoge}{ub}{n}{<-> s*cmsl10}{}
\DeclareFontFamily{OT1}{fuga}{}
\DeclareFontShape {OT1}{fuga}{m} {n}{<-> s*cmfi10}{}
\DeclareFontShape {OT1}{fuga}{sb}{n}{<-> s*cmbxsl10}{}

\def\rmdefault{hoge}\def\sfdefault{fuga}
\def\bfseries@rm{ub}\def\bfseries@sf{sb}
\def\test#1{%
  \par\begingroup#1%
    \xdef\status@af{\f@family/\f@series/\f@shape}%
  123\space\endgroup%
  (\texttt{\status@af})
}
\begin{document}

\test{}
% => hoge/m/n

\test{\fontseries{ub}\selectfont\sffamily}
% => fuga/sb/n

\test{\fontseriesforce{ub}\selectfont\sffamily}
% => changed!
%  * 2020-10-01: fuga/ub/n (fallback -> fuga/m/n)
%  * 2021-06-01: fuga/sb/n

\end{document}

Log file (required) and possibly PDF file

@user227621
Copy link
Contributor

I think that this happens because the "force state" is now reset after every \selectfont. See here:

the force should always be reset by \selectfont not by the next \fontseries

This change was made because not resetting the "forced state" could lead to strange effects: See Issue 3 in this comment.

@aminophen
Copy link
Contributor Author

@user227621 Thanks for the explanation; now I understand your point well.

@FrankMittelbach
Copy link
Member

Yes this is the intended behavior and before it was wrong as the scope of the "force" was not well defined. Now it applies to the next \selectfontas it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants