-
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
[glyphs] Clean up custom params #1141
Conversation
4bbee4b
to
38264d8
Compare
glyphs-reader/src/font.rs
Outdated
@@ -65,6 +62,15 @@ pub struct Font { | |||
// master id => { (name or class, name or class) => adjustment } | |||
pub kerning_ltr: Kerning, | |||
|
|||
pub custom_parameters: CustomFontParameters, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about naming them "FontCustomParameters" instead? To my non-native Engish speaking mind, it reads slightly better as it makes it easier to compare/contrast to the other masters' and instances' custom parameters.
By the way, don't we need to also group the latter two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name sounds good.
And yes, the goal is also to group the other ones, I can take a look at that too.
.map(|v| v as f64), | ||
); | ||
|
||
macro_rules! set_metric { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 much better when they are logically grouped under font.custom_parameters
38264d8
to
5770add
Compare
We're going to need to support a bunch of of these, and it was becoming hard to keep track of what was being handled and what wasn't. This moves all the custom params (at the font level) into a new CustomFontParameters struct. It also reduces boilerplate when these are used in glyphs2fontir. The ultimate goal here is to do smarter parsing of these custom paramaters in such a way as to be able to warn if there are any we aren't handling.
5770add
to
6f5c02b
Compare
We're going to need to support a bunch of of these, and it was becoming hard to keep track of what was being handled and what wasn't. This moves all the custom params (at the font level) into a new CustomFontParameters struct.
It also reduces boilerplate when these are used in glyphs2fontir.
The ultimate goal here is to do smarter parsing of these custom paramaters in such a way as to be able to warn if there are any we aren't handling.