latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.88k stars 262 forks source link

fontenc T1 with \tiny and \sffamily swaps bold <-> regular #879

Closed simon-codes-something closed 1 year ago

simon-codes-something commented 2 years ago

Brief outline of the bug

Loading fontenc with option T1 swaps bold and regular fonts when using \tiny and \sffamily.

Here is what i have tested so far:

Any of the following changes restore the proper boldness

Adding \itshape seems to have no influence on the boldness.

Minimal example showing the bug

\RequirePackage{latexbug} 
\documentclass{article}

\usepackage[T1]{fontenc} %OT1: as expected, T1: bold and regular swapped when tiny

%\usepackage{lmodern} %problem is not present with lmodern
\begin{document}
    \tiny\sffamily should be regular

    \tiny\sffamily\bfseries should be bold
\end{document}

Log file (required) and possibly PDF file

minimal example.log minimal example.pdf

davidcarlisle commented 2 years ago

that is odd, although it seems to be a issue with the fonts rather than latex

this plain tex example access the fonts directly

\font\fxa=ecss1000 at 10pt

\font\fxb=ecsx1000 at 10pt

\font\fva=ecss0500 at 10pt

\font\fvb=ecsx0500 at 10pt

{\fxa one two three}

{\fxb one two three}

{\fva one two three}

{\fvb one two three}

\bye

producing

image

Showing the 10pt design size fonts having the expected correspondence but the 5pt design size regular font is much wider than the 5pt sx version.

u-fischer commented 2 years ago

As a work around you could load \RequirePackage{fix-cm}, it doesn't use this small sizes which are, as David showed, buggy. With it I then get

image

FrankMittelbach commented 2 years ago

The fonts are actually wrong and we will fix it by not using the smallest (wrong sizes) but instead scale down.