# [NTG-context] fit to width by negative letterspacing or narrowing

Hans Hagen pragma at wxs.nl
Tue May 17 13:53:33 CEST 2011

```On 17-5-2011 1:25, Henning Hraban Ramm wrote:
> Hello again, it's been a while... ;-)
>
> I need to pack fixed lines into a fixed width box.
>
> Some years ago I had something similar in plain PostScript, where I
> pre-calculated the width of a text box, let the default font if it would
> fit my max size, otherwise try a narrow font and if that wasn’t enough
> decreased font size until it would fit.
>
> This time I've only one font and must not decrease font size, but must
> use negative kerning and perhaps some artificial narrowing.
> How can I do that with ConTeXt?
> I use MkIV, so any Lua solution is welcome.

\starttext

\definefontfeature[realugly][default][extend=0.25]

\definedfont[Serif*realugly] Only You Can Read This

\stoptext

-----------------------------------------------------------------