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

Do not create empty guidelines array #410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frankrolf
Copy link

Before this change, any f.save() would create an empty guidelines array in the fontinfo.plist.
Since guidelines are an optinal attribute, I do not think this is necessary.

Before this change, any f.save() would create an empty guidelines array in the fontinfo.plist. Since guidelines are an optinal attribute, I do not think this is necessary.
@typemytype
Copy link
Member

this feels very dangerous.. the attribute font.guidelines is a list or an Iterator.

I assume you dont want empty arrays in the ufo xml, this should be moved to fontTools and ufoLib.

@frankrolf
Copy link
Author

Yes, I can see that some tests are failing so possibly not the best fix here – do you have a suggestion where else it should go?

@typemytype
Copy link
Member

ufoLib writes the font.info object, defcon mirrors font.guidelines in the font info object: see https://github.com/robotools/defcon/blob/master/Lib/defcon/objects/info.py#L220-L232

It could be fine to make the info.guidelines more ufoLib friendly and return None if the list is empty. The doc string already clarifies that this attribute is just to have a ufoLib compatibility attribute.

@typesupply

@typesupply
Copy link
Member

This sounds fine to me.

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

Successfully merging this pull request may close these issues.

3 participants