Skip to content

Is it possible to get the "angled" margin of a glyph in an italic font? #280

@arrowtype

Description

@arrowtype

RoboFont has the very useful glyph attributes glyph.angledLeftMargin and glyph.angledRightMargin in its API. This is pretty vital when scripting Italic fonts. If I just ask for the basic left/right margin, it is “wrong” in terms of how I need to manipulate a glyph drawing.

Is there an existing function to get glyph.angledLeftMargin and glyph.angledRightMargin, or object with these attributes (in ufoLib2 or elsewhere, but independent of a font editor)?

As a specific example, if I try to position an ogonek anchor on an italic /E, I am unsure of how to determine the bottom right corner... even though it is the further-right point, if the margin is angled. Even if I use the font.lib["com.typemytype.robofont.italicSlantOffset"] of the UFO, it is still way off, because using the glyph bounds or basic rightMargin value is based on the top right corner. (This makes sense, because the font is ultimately just in a rectangle, and the angled margins are just there to help designers draw italic fonts in a way that makes sense... but when I’m coding, I frequently wish I had a way to do this, too!)

image

Thanks for any tips or pointers, if you happen to have them!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions