-
Notifications
You must be signed in to change notification settings - Fork 14
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
font.renameGlyph() does not rename components #97
Comments
I remember this also being an issue with TruFont/defcon but I can't remember. |
yes I think we should support renaming components as well. glifLib's GlyphSet has a |
by traversing the graph while building a new one with edges reversed def reverse_graph(g):
rev = {}
for v in g:
for e in g[v]:
rev.setdefault(e, []).append(v)
return rev |
and we should probably cache these so that we don't have to rebuild every time we rename one glyph |
Which would mean that now we have to manage the cache. I think we're veering dangereously close to defcon territory here. |
Hm yeah |
That would be best. I currently do this ( for name in list(font.keys()):
new = names.get(name)
if new and new != name:
font.renameGlyph(name, new)
for glyph in font:
for component in glyph.components:
name = component.baseGlyph
new = names.get(name)
if new and new != name:
component.baseGlyph = new |
This would certainly be helpful. |
I’m not sure if this is intentional, but
font.renameGlyph()
leave components withbaseGlyph
using the old name.The text was updated successfully, but these errors were encountered: