Would `fontName.replace(/\W/g, '')` be enough?