[Tex/LaTex] Creating a custom font size

fontsfontsize

In this query, @MartinSharrer provides a nice macro to create a custom fontsize. Unfortunately, I don't understand how to use it.

The code below uses his macro

\documentclass{beamer}
\newlength{\mylength}
\makeatletter
\newcommand{\mycfs}[1]{%
  \normalsize
  \@defaultunits\mylength=#1pt\relax\@nnil
  \edef\@tempa{{\strip@pt\mylength}}%
  \ifx\protect\@typeset@protect
     \edef\@currsize{\noexpand\mycfs\@tempa}% store calculated size
  \fi
  \mylength=1.2\mylength
  \edef\@tempa{\@tempa{\strip@pt\mylength}}%
  \@tempa
  \expandafter\fontsize\@tempa
  \selectfont
}
\makeatother
\begin{document}
{\mycfs{8} This is a test} \\
{\mycfs{7} This is a test} \\
{\mycfs{6} This is a test} \\
{\mycfs{5} This is a test} \\
\end{document}

But produces this output .

The font selection part is great but I can't figure out how to remove the numbers at the beginning of each line. Could somebody advise please?

Best Answer

I can't figure out how to remove the numbers at the beginning of each line.

Simply remove the line that contains just \@tempa.