Skip to content

Can we make font.insertGlyph return that glyph #727

Open
@ryanbugden

Description

@ryanbugden

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']

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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