This repository has been archived by the owner on May 20, 2022. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There remains some polish and cleanup to do, but the overall idea is in place.
This can be folded into `Table`.
Thanks very much for this. It certainly looks a lot tidier. I'm going to work through it, and convert some of the fonttools-cli binaries to the new interface as a way of helping me get a feel for it. The variable font instancer is definitely cleaner, so I'm sure they will be too. (The fact that we have utilities using the library with a variety of degrees of complexity helps us to understand the impact of this kind of change.) |
I was working through the binaries but it sounds like a good idea to have you take a look at that, I think it will be a good gauge of how successful this API is. |
This gets around needing to specify that a given `T` impls default in order for us to use default for GPOSGSUB<T>.
This matches the spec and the behaviour of the python fonttools. This also replaces the looping constructor to use iter/map/collect.
Thanks very much for this. It is clearly much better! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This includes the commit from #54; if we don't want that PR (or want some alternative form) I'll rework this accordingly.
This is the impl of a new API for accessing tables.
I haven't fixed the various other projects & crates yet, because I thought it might be helpful to open this for discussion while I plod through getting CI to pass.
Highlights
TableSet
type that coordinates storing and loading tables.&mut self
.TableSet
orFont
.TableSet
, with the signature,get
methodThere are a few rough edges.
It's annoying that we need to always return
Result<Option<T>>
. I've been daydreaming about having two forms ofFont
, one which has been preloaded and one which hasn't; methods on the former would be infallible, and maybe we could also do things like guarantee that all of the required tables are present? I don't want to worry about this too much right now, but wanted to at least mention it.I'm also not totally sure about the process of mutating tables and mutating fonts; I can imagine a different API where there
Font
is read-only, and if you want to mutate you have to use an explicitFontBuilder
method, and then there would be ato_builder()
method onFont
for constructing that; you would then add or remove tables as desired before calling abuild()
method that would give you a new font. This would be slightly more cumbersome but would also be clearer with regards to the fact that if you get a table and then mutate it you need to put it back in the font for anything to change?Anyway, overall I think this should be quite a bit easier to use.
Simon if you'd like to chat about this at some point let me know!