-
Notifications
You must be signed in to change notification settings - Fork 13
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
LayerSet + other layer-related tweaks #106
Conversation
This takes the previous default_file_name_for_glyph_name function out of the glyph module and moves it to a new `util` module; it then adapts it to also work for layer names.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The idea of putting the default layer permanently into |
Also, the extra effort in normalizer to fish out the layers to delete is... unfortunate. |
Thanks for the feedback, I agree with everything. I also agree it's somewhat a shame that the normalizer example is more verbose now, but I don't really know what an alternative API would be that lets us maintain our guarantees. 🤔 |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
We could have a |
Let's see what some more real-world use cases are, and then we can try and come up with an API that addresses them? |
This adds a LayerSet type that enforces various constraints on layers. Among other things, this means that: - Layer names are now also stored as Arc<str> - There is no more LayerInfo type - there is now always a default layer - the default layer cannot be removed - new layers can be added This also introduces a few other breaking api changes; for instance I'm removing `Font::get_default_layer(&self) -> Option<&Layer>` in favour of `Font::default_layer(&self) -> &Layer`. This was motivated by my experiments with python bindings, but I think this is generally useful independent of that work and so I'm PRing it separately.
This adds a LayerSet type that enforces various constraints on
layers.
Among other things, this means that:
This also introduces a few other breaking api changes; for instance
I'm removing
Font::get_default_layer(&self) -> Option<&Layer>
in favour of
Font::default_layer(&self) -> &Layer
.In addition it moves the "compute a file name from a user provided name"
logic into a new
util
module.This was motivated by my experiments with python bindings,
but I think this is generally useful independent of that work
and so I'm PRing it separately.
LayerSet
type)@madig I caught a few issues here thanks to your tests! 🎉