[Tex/LaTex] Using \fontseries{b}\selectfont does not give me a bold face

boldfonts

I am trying to emulate the font below:

enter image description here

Apparently it can be done with:

\renewcommand*{\firstnamefont}{\fontsize{34}{36}\sffamily\mdseries\upshape}

This is from the moderncv package, more specifically the file moderncvstyleclassic.sty

In my case, I thought I could get it with:

{\fontencoding{T1}\fontfamily{cmss}\fontseries{b}\selectfont This is a test}

But it doesn't work. Instead I get:

enter image description here

which by the way is also what I get with:

{\fontencoding{T1}\fontfamily{cmss}\fontseries{m}\selectfont This is a test}

Notice that the difference between both code snippets is using \fontseries{b} instead of \fontseries{m}

With this:

  • How can I get the font in the first image?
  • Why is it that \fontseries{b} and \fontseries{m} yield the same result above?

Update 1:

If I use

{\fontencoding{T1}\fontfamily{cmss}\fontseries{bx}\selectfont This is a test}

I get:

enter image description here

which is still different from what I show in the top image.

Best Answer

Use lmss instead of cmss:

result of lmss vs. result of cmss

\documentclass{article}

\usepackage{xcolor}

\begin{document}

{\color{red}\tiny\ttfamily lmss}\smallbreak
{\fontsize{34}{36}\fontencoding{T1}\fontfamily{lmss}\fontseries{m}\selectfont This is a test}

{\color{red}\tiny\ttfamily cmss}\smallbreak
{\fontsize{34}{36}\fontencoding{T1}\fontfamily{cmss}\fontseries{m}\selectfont This is a test}

\end{document}
Related Question