fixed compile error add extra check for text drawing, seems to have a problem with large fonts and may have nulll size