How to set a bit that FL7 won't set for me

This one little thing is holding me back. I upgraded from FL5 to FL7 mostly to be able to tick the "Prefer typo metrics" checkbox, but obviously I can't be waiting for a new version to be released every time I need a another checkbox.
Since I have a font that should belong to a family but differs from Regular in a way other than weight or width, I want to follow the advice of @Jens Kutilek seen here:
Putting aside the question of why Fontlab wouldn't do this automatically when anything is written in the "Other" field of the Name info, how do I do this myself? I seem to have some sort of blind spot for how to access these things that are documented in such detail. I'm not a programmer, at least not since Pascal in high school. Opening the font file raw in Notepad sure doesn't give me a clear view of these tables, so what does?


  • RichardWRichardW Posts: 100
    The program ttx seems pretty powerful and is pretty 'close to the metal'.
  • K PeaseK Pease Posts: 182
    Command-line, huh... well, if I must, I must. This is what I get for writing cartoons about Unix users in my younger days without really knowing what I was talking about. Thanks. If there are easier options, I'd still like to hear them.
  • DTL OTMaster

    I use it all the time.
  • K PeaseK Pease Posts: 182
    That certainly answers all questions posed. Now to ponder what my perfectionism is worth to me and whether buyers of my display trash willing to buy more than one font in a family will ever add up to that amount.
  • Peter BakerPeter Baker Posts: 177
    edited February 2022
    If you've got the ability to run ttx, then you've also got the ability to run this little Python script (offered under correction):

    from fontTools import ttLib
    #This also works with CFF-based fonts
    thisFont = ttLib.TTFont('MyFont.ttf')
    thisFont['OS/2'].fsSelection &= 0b1011111111
    thisFont['name'].setName("MyFont Family Name", 21, 3, 1, 0x409)
    thisFont['name'].setName("Subfamily Name", 22, 3, 1, 0x409)'MyFont-altered.ttf')

    (I'm old enough to be able to say I miss the CP/M command line, and as an OpenSource guy who's never made a nickel from a font, I've always got to consider spending a little  time  puzzling over fontTools documentation rather than hundreds of Euros on (admittedly excellent) software.)

  • c.g.c.g. Posts: 53
    If you have the time and patience to install this...
    ftcli os2 -wws 0 INPUT_PATH
    ftcli names set-name --name-id 21 --string "Family Name" --platform win INPUT_PATH
    ftcli names set-name --name-id 22 --string "Subfamily Name" --plaftorm win INPUT_PATH

  • K PeaseK Pease Posts: 182
    Thank you very much. After searching around for the missing pieces of my understanding, I think I have finally worked out how to use Python in Windows. I ran your script, @Peter Baker , but it returns this error message:
    No handlers could be found for "fontTools.ttLib.tables._n_a_m_e"
    I was pretty sure I got pip to retrieve fontTools correctly, so I'm not sure what's wrong.
  • I don't know what "No handlers could be found for" means. I'd suggest trying the script Cesare links to, but it's a frontend for fontTools, so you'll probably get the same error. Maybe someone here will recognize the error message. You're running Python 3.7 or higher, right?
  • Yes, alas, that's the error you get if you try to run the script under an old version of Python. What people mostly do to run fontTools and other font utilities is install the latest version of Python alongside the old one and run a virtual environment, inside which you run your Python programs. There are lots of tutorials online that will guide you through the process step by step.
  • K PeaseK Pease Posts: 182
    Success! My mistake was opening a shell from the folder, which ran an older version for some reason. There are too many ways to open a command line in Windows and all of them are a little different. But simply double-clicking the .py file performs the operation correctly with Python 3.10 and closes itself. Thank you for all your help.
  • Huzzah! Very glad to help.
Sign In or Register to comment.