Closed jblemee closed 10 years ago
Hey,
You can use a better algo based on basic Math :
var fitText = function(parent, width, height) { var minCharPerLine = 10; parent.css('font-size', Math.sqrt( (width*height) / (parent.text().length + minCharPerLine )) ); };
This one will adjust multiline text in the box.
I'm not sure this algorithm works for me b/c we'd have to constantly query for the element's width and height inside a resize() function.
resize()
Thanks for the suggestion tho.
Hey,
You can use a better algo based on basic Math :
This one will adjust multiline text in the box.