`isName(baseFont) ? baseFont.name : baseFont` check will be better. Same for line above (since for some pdfs it can be a string)