N.B.: In order to keep the original question readable (and thus, understandable), you'll find here my trials that were originally posted within the question. Note that there is here no fully satisfying solutions. This post serves more as food for thought, and for not losing time in this stalemates.
Tried solutions
I have found several thread discussing similar problems. I tried some of the suggested solutions.
Using the environ package + minibox + \relsize
For example kongo09's solution to question "Fit text into given box by adjusting the fontsize" works perfectly fine for me... except that the fontsize is increased if the text is not long enough (what I don't want, because if you have a small text within a big frame, you'll get an enormous fontsize, what is ugly).
Using \tcboxfit from the tcolorbox package
As suggested in this solution, there is also the tcboxfit solution. However, it doesn't works as in following MWE
\documentclass[a4]{scrartcl}
\usepackage[most]{tcolorbox}
\tcbset{
colframe=black,
colback=white,
boxsep=0pt,
top=0mm,
bottom=0mm,
left=0mm,
right=0mm,
nobeforeafter,
arc=0pt,
outer arc=0pt
}
\begin{document}
\section*{tcolorbox solution}
\tcboxfit[width=8cm,height=2cm]{
Normal size, short text
}
\tcboxfit[width=8cm,height=2cm]{
\Huge Huge size, short text
}
\vspace*{1cm}
\noindent
\tcboxfit[width=8cm,height=2cm]{
Normal size, but this time it is a very very long text, that is normally longer than 8 centimeters. And there is even more text such as lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque blandit nibh et risus malesuada vehicula. Morbi in finibus ex. Cras dictum velit at lorem maximus, quis imperdiet velit lacinia. Nam lobortis facilisis sapien, eget pharetra ante accumsan eget. Pellentesque volutpat vulputate ligula a pretium. Nam sagittis tempus pellentesque. Donec dolor leo, dignissim eget augue in, maximus vehicula dolor. Pellentesque quis nulla aliquet, fringilla risus sed, molestie nisi. Maecenas imperdiet massa et elit molestie, at semper nulla cursus. Morbi blandit porttitor est eu bibendum. orem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque blandit nibh et risus malesuada vehicula. Morbi in finibus ex. Cras dictum velit at lorem maximus, quis imperdiet velit lacinia. Nam lobortis facilisis sapien, eget pharetra ante accumsan eget. Pellentesque volutpat vulputate ligula a pretium. Nam sagittis tempus pellentesque. Donec dolor leo, dignissim eget augue in, maximus vehicula dolor. Pellentesque quis nulla aliquet, fringilla risus sed, molestie nisi. Maecenas imperdiet massa et elit molestie, at semper nulla cursus. Morbi blandit porttitor est eu bibendum.
}
\tcboxfit[width=8cm,height=2cm]{
\Huge Huge size, but this time it is a very very long text, that is normally longer than 8 centimeters.
}
\vspace*{0.5cm}
\end{document}

As suggested in Steven's comment, I looked at his solution. However, I observe that the original font-size might be increased, and that not all the text width is used when decreasing the font size.
Here is an MWE :
\documentclass[a4]{scrartcl}
\usepackage{scalerel}
\usepackage{fp}
\usepackage{stackengine}
\newcount\boxheight
\newcount\boxwidth
\newlength\constrainedwidth
\newsavebox\testbox
\newlength\currentwidth
\newcommand\aspect[1]{%
\boxheight=\ht#1\relax%
\boxwidth=\wd#1\relax%
\FPdiv\testaspect{\the\boxheight}{\the\boxwidth}%
%\testaspect\\% COMMENT THIS LINE TO REMOVE ASPECT-RATIO PRINTS
}
% TARGET-HEIGHT, TARGET-WIDTH, CONTENT, GUESS>NATURAL-WIDTH, dWIDTH
\newcommand\constraintext[5]{%
\def\svfboxsep{\the\fboxsep}%
\setlength\fboxsep{0pt}%
\setlength\constrainedwidth{#2}%
\sbox\testbox{\rule{#2}{#1}}%
%TARGET ASPECT RATIO\\% COMMENT THIS LINE TO REMOVE COMMENT
%V\\% COMMENT THIS LINE TO REMOVE COMMENT
\aspect{\testbox}%
\edef\aspectratio{\testaspect}%
\constrainsize{#1}{\aspectratio}{#3}{#4}{#5}%
\setlength\fboxsep{\svfboxsep}%
}
\newcommand\constrainsize[5]{%
\sbox{\testbox}{\fbox{\parbox[b]{#4}{#3}}}%
\aspect{\testbox}%
\FPiflt{\testaspect}{#2}%
\setlength{\currentwidth}{#4}%
\addtolength{\currentwidth}{-#5}%
\constrainsize{#1}{#2}{#3}{\currentwidth}{#5}%
\else
\setlength\constrainedwidth{#1}%
\FPdiv\result{1.0}{#2}%
% CHANGE \framebox TO \makebox TO REMOVE FRAME
\framebox[\result\constrainedwidth]{\hfill%
\scaleto{\parbox[b]{\currentwidth}{#3}}{#1}%
\hfill%
}%
\fi%
}
\parindent 0pt
\begin{document}
\section*{Steven's solution}
\constraintext{2cm}{8cm}{
Normal size, short text
}{20cm}{0.1cm}
\constraintext{2cm}{8cm}{
\Huge Huge size, short text
}{20cm}{0.1cm}
\vspace*{1cm}
\noindent
\constraintext{2cm}{8cm}{
Normal size, but this time it is a very very long text, that is normally longer than 8 centimeters. And there is even more text such as lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque blandit nibh et risus malesuada vehicula. Morbi in finibus ex. Cras dictum velit at lorem maximus, quis imperdiet velit lacinia. Nam lobortis facilisis sapien, eget pharetra ante accumsan eget. Pellentesque volutpat vulputate ligula a pretium. Nam sagittis tempus pellentesque. Donec dolor leo, dignissim eget augue in, maximus vehicula dolor. Pellentesque quis nulla aliquet, fringilla risus sed, molestie nisi. Maecenas imperdiet massa et elit molestie, at semper nulla cursus. Morbi blandit porttitor est eu bibendum. orem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque blandit nibh et risus malesuada vehicula. Morbi in finibus ex. Cras dictum velit at lorem maximus, quis imperdiet velit lacinia. Nam lobortis facilisis sapien, eget pharetra ante accumsan eget. Pellentesque volutpat vulputate ligula a pretium. Nam sagittis tempus pellentesque. Donec dolor leo, dignissim eget augue in, maximus vehicula dolor. Pellentesque quis nulla aliquet, fringilla risus sed, molestie nisi. Maecenas imperdiet massa et elit molestie, at semper nulla cursus. Morbi blandit porttitor est eu bibendum.
}{20cm}{0.1cm}
\constraintext{2cm}{8cm}{
\Huge Huge size, but this time it is a very very long text, that is normally longer than 8 centimeters.
}{20cm}{0.1cm}
\end{document}

Using the adjustbox package
I also have heard about the adjustbox package, that -- imho -- seems adapted to my issue. However, after some trials, I cannot find the parameters that fit my requirements. I have explored two solutions :
- an environment based on the
\adjustbox command,
- the
\adjustbox
The first works well, except that I cannot make it force to respect the vertical maximal dimension. The latter is not acceptable in this case since it doesn't accept linebreaks, itemizations, etc.
Here is my MWE :
\documentclass[a4]{scrartcl}
\usepackage[calc]{adjustbox}
\newenvironment{fitbox}[2]{% \begin{fitbox}{<width>}{<height>} stuff \end{fitbox}
\def\Xwidth{#1}
\def\Yheight{#2}
\noindent
\adjustbox{
frame,
margin= 0pt 0pt 0pt 0pt,
minipage=[c][\Yheight]{\Xwidth},
min width=\Xwidth ,
min totalheight=\Yheight ,
max width=\Xwidth ,
max totalheight=\Yheight ,
env={minipage}[t][\Yheight]{\Xwidth}
}\bgroup
}{%
\egroup
}
\begin{document}
\section{fitbox solution}
\begin{fitbox}{8cm}{2cm}
Normal size, short text
\end{fitbox}
\begin{fitbox}{8cm}{2cm}
\Huge Huge size, short text
\end{fitbox}
\vspace*{1cm}
\begin{fitbox}{8cm}{2cm}
Normal size, but this time it is a very very long text, that is normally longer than 8 centimeters.
\end{fitbox}
\begin{fitbox}{8cm}{2cm}
\Huge Huge size, but this time it is a very very long text, that is normally longer than 8 centimeters.
\end{fitbox}
\vspace*{0.5cm}
\section{maxsizebox solution}
\maxsizebox*{8cm}{2cm}{\fbox{Normal size, short text}}
\maxsizebox*{8cm}{2cm}{\fbox{\Huge Huge size, short text }}
\noindent
\maxsizebox*{8cm}{2cm}{\fbox{Normal size, but this time it is a very very long text, that is normally longer than 8 centimeters.}}
\maxsizebox*{8cm}{2cm}{\fbox{\Huge Huge size, but this time it is a very very long text, that is normally longer than 8 centimeters.}}
\end{document}
And its output :
