The setup is a little bit more convoluted in this case because we have to come up with a completely new algorithm here. The one you posted typesets stuff in a box and loops over the fontsize (increasing) until a certain height is achieved. Here we want to typeset stuff in a box, examine if it is too wide and decrease the fontsize. That means we start from a ridiculously large fontsize (I chose 100pt).
Now the problem is, that we set stuff in a vbox at a fixed width (\textwidth for simplicity). How do we know whether a line is too wide? Victor Eijkhout presented a method for that in his book TeX by Topic which he called \eatlines. I adapted this to measure the width of the line and set a boolean value depending on whether the width is met or not. The only thing left to do is loop over the fontsize (here in steps of 1pt, decreasing). I also handle the case that the fontsize decreases below 0pt, in which case the content can never be fit in the box (which shouldn't happen), but leaving out this case would then result in an infinite loop.
\newdimen\coverwidth \coverwidth = \textwidth
\newdimen\coverfont \coverfont = 100pt
\newdimen\fontstep \fontstep = 1pt
\newconditional\widthmet
\def\startcover
{\dostartbuffer[cover][startcover][stopcover]}
\def\stopcover
{\setups[cover:place]}
\def\eatlines{%
\global\settrue\widthmet
\setbox\scratchboxone=\lastbox
\ifvoid\scratchboxone\else
\unskip\unpenalty
{\eatlines}%
\copy\scratchboxone
\setbox\scratchboxtwo=\hbox{\unhbox\scratchboxone}%
\ifdim\wd\scratchboxtwo>\coverwidth
\global\setfalse\widthmet
\fi
\fi
}
\startsetups cover:place
\start\dontcomplain
\doloop{%
\setbox\scratchbox=\vbox{\hsize=\coverwidth
\definedfont[Serif at \the\coverfont]\setupinterlinespace
\setupalign[nothyphenated]\emergencystretch\maxdimen
\getbuffer[cover]%
\par\eatlines
}%
\ifconditional\widthmet
\box\scratchbox
\exitloop
\else
\global\advance\coverfont by -\fontstep
\fi
\ifdim\coverfont<0pt
\exitloop
\fi
}
\stop
\stopsetups
\starttext
\startcover
Mary Poppins Sings Supercalifragilisticexpialidocious
\stopcover
\stoptext
Output (with \showboxes):

ConTeXt makes it quite easy to add a comprehensive key-value interface to this so you could use things like
\startcover[width=2in]
Mary Poppins Sings Supercalifragilisticexpialidocious
\stopcover
\definecover[whatever][maxsize=200pt]
\setupcover[whatever][stepsize=5pt]
\startwhatever[width=4in]
Mary Poppins Sings Supercalifragilisticexpialidocious
\stopwhatever
This might seem a little exaggerated, but one could even go further and put the stuff in a module, so you'd only have to \usemodule[cover] and you are set. Save the following as t-cover.mkiv in your working directory.
\startmodule[cover]
\unprotect
\installcorenamespace{cover}
\installcommandhandler \??cover {cover} \??cover
\startinterface all
\setinterfaceconstant {maxsize} {maxsize}
\setinterfaceconstant {stepsize} {stepsize}
\stopinterface
\appendtoks
\setuevalue{\e!start\currentcover}{\cover_start[\currentcover]}%
\setuvalue {\e!stop\currentcover}{\cover_process}%
\to \everydefinecover
\setupcover[
\c!width=\textwidth,
\c!maxsize=100pt,
\c!stepsize=1pt,
]
\unexpanded\def\cover_start
{\bgroup\obeylines\dodoubleargument\cover_start_indeed}
\starttexdefinition cover_start_indeed [#1][#2]
\egroup
\edef\currentcover{#1}
\setupcover[#1][#2]
\grabbufferdata[coverbuffer][start#1][stop#1]
\stoptexdefinition
\unexpanded\def\cover_process{%
\start\dontcomplain
\scratchdimen=\coverparameter\c!maxsize
\doloop{%
\setbox\scratchbox=\vbox{\hsize=\coverparameter\c!width
\definedfont[Serif at \the\scratchdimen]\setupinterlinespace
\setupalign[nothyphenated]\emergencystretch\maxdimen
\getbuffer[coverbuffer]%
\par\eatlines
}%
\ifconditional\scratchcounter
\box\scratchbox
\exitloop
\else
\global\advance\scratchdimen by -\coverparameter\c!stepsize
\fi
\ifdim\scratchdimen<0pt
\exitloop
\fi
}%
\stop
}
\def\eatlines{%
\global\settrue\scratchcounter
\setbox\scratchboxone=\lastbox
\ifvoid\scratchboxone\else
\unskip\unpenalty
{\eatlines}%
\copy\scratchboxone
\setbox\scratchboxtwo=\hbox{\unhbox\scratchboxone}%
\ifdim\wd\scratchboxtwo>\coverparameter\c!width
\global\setfalse\scratchcounter
\fi
\fi
}
\definecover[cover]
\protect
\stopmodule
Then your main file would read
\usemodule[cover]
\starttext
\startcover
Mary Poppins Sings Supercalifragilisticexpialidocious
\stopcover
\stoptext
Supercalifragilisticexpialidocious. – Steven B. Segletes Apr 25 '17 at 14:42Supercalifragilisticexpialidociousto fit on a single line of the book cover. Perhaps, look at this: https://tex.stackexchange.com/questions/123614/making-the-text-fit-in-a-specific-space-in-latex – Steven B. Segletes Apr 25 '17 at 14:46