Test if textStyle properties exists before setting the print style

Fix #1816