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

EC fonts silently remap italic to slanted #172

Closed
hmenke opened this issue Aug 25, 2019 · 6 comments
Closed

EC fonts silently remap italic to slanted #172

hmenke opened this issue Aug 25, 2019 · 6 comments

Comments

@hmenke
Copy link

hmenke commented Aug 25, 2019

Brief outline of the bug

Typesetting the minial example below produces a missing font warning in the log as expected:

LaTeX Font Warning: Font shape `OT1/cmss/m/it' in size <10> not available
(Font)              Font shape `OT1/cmss/m/sl' tried instead on input line 4.

However commenting in the \usepackage[T1]{fontenc} line makes this warning disappear, even though the EC fonts do not provide an italic version of Computer Modern. Instead, the italic alphabet is simply remapped to slanted:

latex2e/base/cmfonts.fdd

Lines 494 to 495 in 06814a3

\EC@family{T1}{cmss}{m}{sl}{ecsi}
\EC@family{T1}{cmss}{m}{it}{ecsi}

While this has no functional impact, I believe that this is “false advertising”. Remapping to slanted should still take place but also a warning should be printed to emphasize that there is actually no italic variant of cmss in T1 encoding.

Minimal example showing the bug

\RequirePackage{latexbug}
\documentclass{article}
%\usepackage[T1]{fontenc}
\begin{document}
\sffamily\textit{Hi!}
\end{document}

Log file (required) and possibly PDF file

test.log

@hmenke hmenke changed the title EC fonts silently remap slanted to italic EC fonts silently remap italic to slanted Aug 25, 2019
@eg9
Copy link
Contributor

eg9 commented Aug 25, 2019

I'm not sure this can be classified as a bug. In general, there is no italic shape for sans serif fonts, but slanted. In t1cmss.fd we find

\EC@family{T1}{cmss}{m}{sl}{ecsi}
\EC@family{T1}{cmss}{m}{it}{ecsi}

so both it and sl are mapped to the same font. In ot1cmss.fd a different choice was made, namely

\DeclareFontShape{OT1}{cmss}{m}{it}
      {<->sub*cmss/m/sl}{}

which I consider suboptimal.

The creators of European Modern decided for ecsi because they wanted to stick to four letters. It's just a question of naming.

@FrankMittelbach
Copy link
Member

Not quite sure why you consider the ot1css.fd choice sub-optimal @eg9, it does correctly reflect the situation, does it not? Suboptimal because it produces warnings when you can't do anything about them?

Some warning about substitution can be helpful and while it is true that sans fonts usually only offer an oblique shape this is not universally true, there are a few that have real italics.

However, if you consider that \emph always switches to italics making that change only means that you get more substitution warnings for cases you can't really change (which I think was the main reason for the EC decision (we didn't actually alter the EC support files when we integrated them in LaTeX).

Probably for the same reason most newer sans fonts (e.g., all that have been provided via autoinst) use it -> sl and not sl -> it for probably exactly the same reason even though technically speaking that is even "wronger" but at least it avoids the warning when you can't to anything about and only warns if you use \slshape which means you probably tried to use both sl and it.

So all in all I think a change would not really be helpful or perhaps if changed than following the approach that autoinst is using even if that is technically wrong.

@FrankMittelbach FrankMittelbach self-assigned this Nov 7, 2019
@FrankMittelbach FrankMittelbach added this to Pool (unscheduled issues) in upcoming LaTeX2e releases via automation Nov 7, 2019
@FrankMittelbach FrankMittelbach added this to the release 2020 spring milestone Nov 7, 2019
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to To do in upcoming LaTeX2e releases Nov 20, 2019
@FrankMittelbach
Copy link
Member

CMSS fonts in OT1 will now silently (log info only) substitute it shape to sl. But the log info will remain.

@FrankMittelbach FrankMittelbach moved this from To do to Done in dev in upcoming LaTeX2e releases Dec 2, 2019
@FrankMittelbach FrankMittelbach added the fixed in dev Fixed in development branch, not in stable release label Dec 2, 2019
@hmenke
Copy link
Author

hmenke commented Dec 2, 2019

There is zero advantage from just logging, because most editors parse the log file, so users will still be bothered by this warning.

@FrankMittelbach
Copy link
Member

... and all fonts other than CMSS in T1 show the substituation in the log but not on the terminal usually. so that is the normal behavior T1cmss is the odd one here, but making that produce a warning after 20 years without isn't going to happen. Sorry, if this is not getting your approval, but we aren't going to fully drop the substitution info.

By the way, there is a difference: it doesn't say Warning it say Info if it only goes in the log.

@hmenke
Copy link
Author

hmenke commented Dec 2, 2019

Ah, I see. If the level is Info, it won't be shown in the quick-fix log of most editors.

upcoming LaTeX2e releases automation moved this from Done in dev to Done Jan 31, 2020
@FrankMittelbach FrankMittelbach removed the fixed in dev Fixed in development branch, not in stable release label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants