you can compare the offsetsize and the scrollsize if you want to detect if the object is overflowing
it would work like this
if( element.offsetHeight < element.scrollHeight ||
element.offsetWidth < element.scrollWidth){
console.log("element is overflowing");
// change the font size here
} else {
// do probably nothing here
}