Open PeterDekkers opened 6 months ago
P.S.: This said, if the purpose of your script is only to make the fonts work for Framer, then maybe your approach is okay. I merely wanted to point out how fiddly font naming can be—the Microsoft OpenType Spec isn't the most straight-forward document to read and implement.
Hello!
I noticed that your script applies the
--subfamily-name
argument to theSUBFAMILY
(ID2
) entry in thename
table. This is (sadly) not always correct.The following is an excerpt from https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids about
SUBFAMILY
(ID2
):So, e.g. for "Arial Black", you would pass the following arguments:
However, then
SUBFAMILY
(ID2
) would be set toBlack
, incorrectly.In the context of Framer, I feel that the best way to retrieve a name for a font would be to look at
PREFERRED_FAMILY
(ID16
) andPREFERRED_SUBFAMILY
(ID17
). If those are not set, thenFAMILY
(ID1
) andSUBFAMILY
(ID2
) values can be used.IDs
1
&2
are subject to a number of restrictions and peculiarities that IDs16
&17
are not subject to. But, values for IDs16
&17
will not always be present.Additionally, deriving the names from the source filename is bound to be prone to error. I would recommend reading values from the
name
table, if you can.I hope this is helpful!