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

Can we make font.insertGlyph return that glyph #727

Open
ryanbugden opened this issue May 9, 2024 · 0 comments
Open

Can we make font.insertGlyph return that glyph #727

ryanbugden opened this issue May 9, 2024 · 0 comments

Comments

@ryanbugden
Copy link

ryanbugden commented May 9, 2024

It would be useful to be able to store the just-inserted glyph into a variable on the fly.

f = CurrentFont()
new_glyph = f.insertGlyph(f['a'], 'b')
new_glyph.moveBy((999,999))

Currently, these are the options:

  1. With insertGlyph
f = CurrentFont()
f.insertGlyph(f['a'], 'b')
new_glyph = f['b']
new_glyph.moveBy((999,999))
  1. With newGlyph
f = CurrentFont()
new_glyph = f.newGlyph('b')
new_glyph.appendGlyph(f['a'])
new_glyph.width = f['a'].width
new_glyph.moveBy((999,999))
  1. The best way probably, but not really documented:
f = CurrentFont()
new_glyph = f['b'] = f['a']
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

1 participant