added assert to check that a font is set before text is written