Fix bug #17524 with crashes in creating a new frame with invalid font.