-
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
Improve plist handling #62
Comments
Issue unified-font-object/ufo-spec#128 tells me that fontinfo should really be treated as a grab bag of stuff with prescribed value types and validators for certain keys, like an enforcement and validation structure sitting on top of a bare plist. Not sure how to handle getting data in and out of it though, i.e. imagine being a UFO compiler and querying e.g. |
An additional point is that serde errors apparently aren't chained, so you'll get e.g. the one shown in #245 (comment). I don't know if you can make serde give more context, but it's something that should be tackled if we handle fontinfo differently. |
Someone pointed me to https://docs.rs/serde_path_to_error/latest/serde_path_to_error/. |
This has been discussed but feels worth having a tracking issue.
There are a few different things going on here. I'll quote @madig on zulip:
fontinfo.plist
: The problem with fontinfo.plist is that it's huge, and has tons of optional keys, and so using serde to create a struct ends up both generating a lot of code and also creating this huge struct that must also be impacting binary size. It would be nice to replace this with some sort of typed dictionary, kind of like druid'sEnv
.lib.plist
: this probably doesn't need to change, and should just be a plist object. We might also want to expose API that lets people try and deserialize this to some concrete struct, if we want?serde
able type here, but it will be hard to make that play nice in the type system.This all feels very doable; I'm going to start by testing out the tweaks to
fontinfo
, and seeing how that feels.The text was updated successfully, but these errors were encountered: