settosize – Scale text to given width
The package defines a command
\set <text> \in <font> \to <size>
that chooses the “best” magstep that will fit the given text into the width, and typesets the text accordingly.
Maybe you are interested in the following packages as well.
- varisize: Change font size in Plain TeX
- smaller: Choose an "adjacent" size in LaTeX
- settosize-ltx: Scale text to make it fit a given width
- gkpmac: The macros used in "Concrete Mathematics"