-
Notifications
You must be signed in to change notification settings - Fork 44
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
Why not Anchor Lib? #245
Comments
There is an issue on the topic of ligature anchor which expended to better anchors in general on the ufo-spec: unified-font-object/ufo-spec#32 |
Currently, there isn't an anchor |
The lib would need to be stored somewhere and the UFO doesn't support that. We considered adding a
Something like this: # storage location
libKey = "design.bahman.anchorstuff.something.etc"
if libKey not in glyph.lib:
glyph.lib[libKey] = {}
# get the anchor's identifier
identifier = anchor.generateIdentifier()
# store the anchor's data
glyph.lib[libKey][identifier] = dict(foo=1, bar="yes", hello="world") You can then reference that as needed. Does that help? |
Thank you very much for your input. What you suggested Tal is a good solution for now and it helps. But it also opens a room for unexpected things to happen. This way if the anchor gets deleted then the information still remains in the UFO: glyph = CurrentGlyph()
anchors = []
libKey = "design.bahman.anchorstuff.something.etc"
if libKey not in glyph.lib:
glyph.lib[libKey] = {}
for anchor in glyph.anchors:
identifier = anchor.getIdentifier()
glyph.lib[libKey][identifier] = dict(foo=1, bar="yes", hello="world")
anchors.append(anchor)
for anchor in anchors:
glyph.removeAnchor(anchor)
print(glyph.lib[libKey]) Also I think adding the anchor lib would be cleaner to interpret and also more explicit in terms of being pythonic. |
If a script is dealing with generating contextual mark positioning and the information was inside the anchor lib not in its name then it would be more convenient to interpret the anchor while generating the feature. Also differentiating the cursive attachment anchor and mark positioning anchor is primitive atm. Right now the method is to have a certain naming scheme for the anchors but if the information that is going to be interpreted while generating the mark positioning is larger then differentiating the anchors just by name seems inconvenient and messy. If there was an anchor lib, I suppose I could add a string 'type' key to the anchor lib and explicitly say it's a cursive attachment anchor by putting a string 'cursive' as the value of the key. Also using 'context' and then putting some other information there. Imagine if the context is large, then naming the anchor to indicate this is not the way to go. Why not adding a lib or some sort of mechanism to take care of this in the anchors?
The text was updated successfully, but these errors were encountered: