made font detection more generic