title: Variable font height via tables in LaTeX
body: <p>I've been looking for a more elegant solution to the following typesetting problem. Consider those banners found in print media where the text is aligned like:</p>
  
  <pre><code>B    I    G        T   E   X   T
  small text small text small text
  m o r e    m e d i u m   t e x t
  </code></pre>
  
  <p>The font sizes are adjusted so that the height is scaled down for longer lines of text such that each line has equal width. I've written a small script that runs each line separately, compiles, crops the resulting pdf and then <code>\includegraphics</code> each in a table. This gives the desired effect but requires an both an outside script and pdfcrop (which only crops to a white bounding box). Since much of LaTeX is self-aware, I imagine it would be possible to have it recognize the width of a box and scale it appropriately so that any text fits exactly into the desired width.</p>
  
  <p>Any thoughts or ideas on how a pure LaTeX implementation might work?</p>
  
  <p><strong>EDIT</strong> As a supplement to the suggested solution by AVB (since large code in comments looks awful), I've posted below the code used so that others may find it easily.</p>
  
  <pre><code>\documentclass[]{article}
  \usepackage[pdftex]{graphicx}
  \begin{document}
  \begin{table}[l]
  \resizebox{10cm}{!}{BIG Text} \\
  \resizebox{10cm}{!}{small text small text small text} \\ 
  \resizebox{10cm}{!}{Medium Text Medium Text}
  \end{table} \end{document} 
  </code></pre>