[Tex/LaTex] \textbf{text} without increasing the length of the text

beamerboldfontsmacros

When using \textbf{text}, the length of text will be increased. Is there a way to make the text bold face without increasing its length?

edit:

Thanks to @Herbert and @Martin, here is a perfect solution for me:

   \newsavebox\CBox 
   \newcommand<>*\textBF[1]{\sbox\CBox{#1}\resizebox{\wd\CBox}{\ht\CBox}{\textbf#2{#1}}}

Best Answer

\documentclass{article}
\usepackage{graphicx}
\newsavebox\CBox
\def\textBF#1{\sbox\CBox{#1}\resizebox{\wd\CBox}{\ht\CBox}{\textbf{#1}}}
\parindent=0pt
\begin{document}
foobarbaz y\\
\textbf{foobarbaz} y\\
\textBF{foobarbaz} y

\end{document}

enter image description here

The example for beamer

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\newsavebox\CBox
\newcommand<>*\textBF[1]{\only#2{\sbox\CBox{#1}\resizebox{\wd\CBox}{\ht\CBox}{\textbf{#1}}}}
\parindent=0pt
\begin{document}
\begin{frame}{foo}
\only<1>{foobarbaz y1} 
\textbf<2->{foobarbaz y2}
\textBF<3>{foobarbaz y3}
\end{frame}

\end{document}

Another (better) possibility is to use the letter spacing option from the package microtype