Fabricjs Textbox make the text shrink to fit
<p>I would define a text box (single-line)</p>

<p>By default, with a character size of 16 (for example)</p>

<p>When the text gets bigger than the text box, I do not want it to wrap or the text box gets bigger, I want the text size to fit the maximum size of the text box. text. When the text returns to a smaller size, it can resume its initial size (in our example 16). Possibly manage a minimum size</p>

<p>If you have an idea, I take :)</p>

<p>thanks in advance</p>

<p>Test Case : <a href="http://jsfiddle.net/Da7SP/273/" rel="noreferrer">http://jsfiddle.net/Da7SP/273/</a></p>

<pre><code>// initialize fabric canvas and assign to global windows object for debug
var canvas = window._canvas = new fabric.Canvas('c');

// ADD YOUR CODE HERE
var canvas = window._canvas = new fabric.Canvas('c');
var t1 = new fabric.Textbox('My Text', {
    width: 200,
    top: 5,
    left: 5,
    fontSize: 16,
    textAlign: 'center'
});

var t2 = new fabric.Textbox('My text is longer, but I do not want the box to grow, or the text to wrap. I only want the text to fit the available size', {
    width: 200,
    height: 200,
    top: 250,
    left: 5,
    fontSize: 16,
    textAlign: 'center'
});



canvas.add(t1);
canvas.add(t2);
</code></pre>

<p>A small video to explain what I want :</p>

<p><a href="https://i.stack.imgur.com/CipHL.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/CipHL.gif" alt="enter image description here"></a></p>

<p>When the text gets bigger than the text box, I want the text size fit the maximum size of the text box. </p>