fixed segv for files with wrong font types