remove kerning pair

RoboFont Forums Help / General remove kerning pair

This topic contains 5 replies, has 3 voices, and was last updated by  jo 6 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5923

    jo
    Participant

    hello, i see there is the method “kerning.remove(pair)” and i thought it will delete the kerning pair but in fact it just sets the value to zero and keeps the pair.
    is that intended that way? if yes what would be a good way to remove a kerning pair with a script?

    thanks. jo

    #5926

    frederik
    Keymaster
    #5927

    frederik
    Keymaster

    but

    del font.kerning[pair]
    

    should work :)

    #5929

    jo
    Participant

    setting to zero with remove seems a bit strange but thanks a lot for the help.
    i tried del before, but I guess I did something wrong, since it did not work.
    not it worked just fine.
    thanks! j

    #5933

    Jens K.
    Participant

    Setting a kern pair to zero in fact deletes it: https://github.com/robofab-developers/robofab/blob/master/Lib/robofab/objects/objectsBase.py#L3119-L3121

    I can think of at least one case in which you would want to differentiate between a value of 0 and a nonexisting kern value, which is when the kerning pair is an exception to a class pair.

    #5934

    jo
    Participant

    hello jens, thanks for your help.
    in fact your example is what “happened” in my case.
    I did some very quick kerning without groups. Later on I replaced the single letters of the pairs with groups through a script. I also wanted to remove the original pair but the zero value was “overwriting” the group value.
    so i guess it could work with kerning update etc but the “del” way worked just fine.
    cheers, jo

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.