googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
151 stars 43 forks source link

ufo2ft adds `openTypeNamePreferredSubfamilyName` without adding `openTypeNamePreferredFamilyName` #744

Closed typoman closed 1 year ago

typoman commented 1 year ago

This might not be a bug, but in case these two fields are not filled in a ufo, ufo2ft only adds the openTypeNamePreferredSubfamilyName and not the second. I couldn't also force ufo2ft not to add openTypeNamePreferredSubfamilyName if it's set to None. If a font is already defined as a RBIBI font in the styleMapStyleName this is not required.

https://github.com/googlefonts/ufo2ft/blob/0d2688cd847d003b41104534d16973f72ef26c40/Lib/ufo2ft/outlineCompiler.py#L418

anthrotype commented 1 year ago

Can you please provide an example?

If I'm understanding this correctly, you're proposing that ufo2ft only omits nameID 16 and 17 if both are equal to their respective legacy nameID 1 and 2, otherwise keep them both: e.g. from

        if nameVals[1] == nameVals[16]:
            del nameVals[16]
        if nameVals[2] == nameVals[17]:
            del nameVals[17]

to

        if nameVals[1] == nameVals[16] and nameVals[2] == nameVals[17]:
            del nameVals[16]
            del nameVals[17]
behdad commented 1 year ago

If I'm understanding this correctly, you're proposing that ufo2ft only omits nameID 16 and 17 if both are equal to their respective legacy nameID 1 and 2, otherwise keep them both: e.g. from

That makes sense to me.

typoman commented 1 year ago

You're correct @anthrotype , ID 16 and 17 are related, and they should both be included or not, so the second if statement you mentioned is correct. I can share an example later if needed, I need to dig up my older commits to a project that is closed.

anthrotype commented 1 year ago

I can share an example later if needed

that would be nice, thanks