latex2e icon indicating copy to clipboard operation
latex2e copied to clipboard

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

Open simon-codes-something opened this issue 2 years ago • 3 comments

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

  • using OT1 instead of T1
  • changing the fontsize (tested up to \Large)
  • removing \sffamily
  • loading a different font (tested with lmodern)

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

simon-codes-something avatar Jun 26 '22 08:06 simon-codes-something

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.

davidcarlisle avatar Jun 26 '22 09:06 davidcarlisle

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

u-fischer avatar Jun 26 '22 09:06 u-fischer

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

FrankMittelbach avatar Jul 08 '22 11:07 FrankMittelbach