SOLVED Can I set os/2 font info (or other OpenType info) in script?

  • TL;DR: the answer to my question is the spec at

    It's very simple to set basic font info through script:

    # Update the family name of the current font
    CurrentFont().info.familyName = "New Family Name"

    This is great, as it allows me to efficiently update font info across many fonts, like this:

    from vanilla.dialogs import *
    inputFonts = getFile("select UFOs", allowsMultipleSelection=True, fileTypes=["ufo"])
    for fontPath in inputFonts:
        f = OpenFont(fontPath, showInterface=False) = "New Family Name"

    However, I'm struggling to set OS/2 info in fonts. My expectation is that something like = "ARRW" or = "ARRW" or would work, but they're not.

    This will be even more important for me to set the vertical metrics (usWinAscent, typoDescent, etc) how I want to across many fonts.

    Ultimately, I hope to create one script that sets any font info across many masters (24+). Beyond help(, which only gives partial insight, how can I learn the methods to set arbitrary font info?

    UPDATE: Just before I submitted this, I found the UFO3 spec, which is just the master list I was hoping for. So, my question is solved, but I'll post this anyway, so it's easier for the next person (possibly myself in the future) to find.

    I can set the vendor ID like this: = "ARRW"

    And I can set the Hhea Descender like this: = -350

  • @ThunderNixon aw:) 💅

  • Connor, I love you.


  • Amazing; two great replies! Thanks so much :)

  • admin


  • This is why I made these, no more remembering long attributes:)

  • admin

    the spec is the place to learn about attributes, also it describes where the values go to while generating a binary.

    programmatically you can get all ufo3 font info attributes with:

    f = CurrentFont()

Log in to reply