[glyphs-reader] Add log-once mechanism to avoid repetitive warnings#1681
Merged
Conversation
Implements log_once_warn! macro to deduplicate warnings like "unknown custom parameter 'xHeight'" that previously could appear multiple times when parsing .glyphs font with several masters/instances. Fixes #1680
Member
Author
|
I wonder why we see stuff like 'Axis Mappings' or 'Variable Font Origin' in here, I believe we do support these already... 🤔 |
Member
Author
I filed separate a issue for this #1682 |
…ams() to avoid 'unknown' warnings
Previously, some special custom parameters like "Axis Mappings", "Axis Location", and "Variable Font Origin" were triggering false "unknown custom parameter" logging warnings because they would fall through the match statement in RawCustomParams::to_custom_params() method.
Here we make so that these special parameters get extracted and parsed ('consumed') before the generic to_custom_params() conversion runs, which prevents them from being flagged as 'unknown'.
Fixes #1682
Replace Vec::remove() with std::mem::take() in custom parameter handling to avoid O(n) element shifting. Parameters are now marked with sentinel values (Default) instead of being removed from the Vec.
…params [glyphs-reader] handle special custom parameters before to_custom_params() to avoid 'unknown' warnings
Member
Author
rsheeter
reviewed
Oct 7, 2025
rsheeter
approved these changes
Oct 7, 2025
4109da2 to
ebb84ed
Compare
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.
Implements
log_once_warn!macro to deduplicate warnings like "unknown custom parameter 'xHeight'" that previously could appear multiple times when parsing .glyphs font with several masters/instances.Fixes #1680