Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arrowtype opened this issue Jul 4, 2023 · 2 comments
Open

Comments

@arrowtype
Copy link

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!

@anthrotype
Copy link
Member

anthrotype commented Jul 4, 2023

Is there an existing function

no, but we could add one I suppose, if needed. Do defcon or fontParts have something like that that we can borrow?

@arrowtype
Copy link
Author

Unfortunately, no, neither defcon nor fontParts have something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants