Add a function to list tags to the FontTableProvider trait.#99
Closed
gendx wants to merge 1 commit into
Closed
Conversation
Contributor
|
Thanks for this. However, I have made the same change in some unreleased work to add some preliminary variable fonts support. That should be done early in the new year. I'll close this PR for now. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Until now, the
FontTableProvideronly allowed to find the table for a specific tag. This adds a function to list all the tags present in the font.The proposed API is
fn table_tags(&self) -> Vec<u32>.fn table_tags(&self) -> impl Iterator<Item = u32>, but that would require return-positionimpl Traitin trait (RPITIT) syntax that will stabilize in Rust 1.75 next week. Using RPITIT would also prevent theFontTableProvidertrait from being "object safe", which would mean that theDynamicFontTableProviderwould not be able to use adyn FontTableProvider(it could use an enum over all possible providers though).It could also be useful to have a function directly returning a collection of
(tag, table)(or animpl Iterator), so that one wouldn't need to find the table for each tag after listing the tags. CurrentlyWoff2TableProviderprovides theinto_tables(self) -> HashMap<u32, Box<[u8]>>function, but it's not clear to me whether aHashMapis the best type for all font providers.