photopea / Typr.js

Typr.js - process fonts in Javascript
MIT License
914 stars 73 forks source link

Incorrect postScriptName #19

Closed jakubzitny closed 6 years ago

jakubzitny commented 6 years ago

Hi, I stumbled upon a font that seems to have incorrect postScriptName detected by Typr.js.

It's Social-Shapes font, you can download it from here.

Most of other parsers detect the postScriptName correctly as Social-Shapes. Typr.js detects Social Shapes. Empty space in postScriptName is not even valid.

I was trying to find a possible bug in adding the offsets in your code, but couldn't really find anything.

photopea commented 6 years ago

Hi, I am sorry for the delayed answer.

Your font really has "Social Shapes" as the postScriptName. Empty space is not valid - you should say it to the font author :D

Anyway, I think, that when there is a space in postScriptName, the software usually replaces it with "-" for the internal representation of the postScriptName. So whenever you access the postScriptName, just replace spaces with dashes and you should be fine. I guess we could even rewrite that internally during the parsing in Typr.js.

jakubzitny commented 6 years ago

Thanks for the info, yeah, I will replace it myself.