The only solution I found is to actually count the number of lines and set the font accordingly.
If the number of lines of string is greater than number of rows of merged cells (5 in my case) then set the font smaller.
if (substr_count($return_to, "\n") <= 4){ //count 5 lines or less -> font = 10
$this->excel->getActiveSheet()->getStyle("A28")->getFont()->setSize(10);
}else{ //count more than 5 lines -> font = 9
$this->excel->getActiveSheet()->getStyle("A28")->getFont()->setSize(9);
}