better font-type handling