[glyphs] Fix logic bug in category construction#1714
Merged
Conversation
rsheeter
reviewed
Oct 22, 2025
| .map(|name| self.query_no_synthesis(name, None)) | ||
| .collect(); | ||
| if let Some(first_attr) = base_names_attributes.first() { | ||
| if let Some(first_attr) = base_names_attributes.first().unwrap() { |
Contributor
There was a problem hiding this comment.
Maybe a comment wrt unwrap safety?
rsheeter
approved these changes
Oct 22, 2025
anthrotype
approved these changes
Oct 22, 2025
| #[test] | ||
| fn unknown_name_combined_with_mark() { | ||
| // if first part is unknown, we don't assign a category | ||
| assert_eq!(get_category("Whata-WEIRDNameLOL_brevecomb", &[]), None) |
Member
There was a problem hiding this comment.
Suggested change
| assert_eq!(get_category("Whata-WEIRDNameLOL_brevecomb", &[]), None) | |
| assert_eq!(get_category("Whata-WEIRDNameLOL_brevecomb", &[]), None); |
Member
Author
There was a problem hiding this comment.
the assert returns () which is the implied return value of the fn, so this is allowed 🤷
Member
There was a problem hiding this comment.
so you did it on purpose? naughty boy
A misplaced 'filter_map' was causing us to skip the (null) attributes of the first glyph in a ligature sequence if that glyph had a name we could not recognize. This caused us to treat the second glyph as the first, and so miscategorize various glyphs as non-spacing marks, which was causing various little diffs.
faf5e0a to
10aec60
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.
A misplaced 'filter_map' was causing us to skip the (null) attributes of the first glyph in a ligature sequence if that glyph had a name we could not recognize. This caused us to treat the second glyph as the first, and so miscategorize various glyphs as non-spacing marks, which was causing various little diffs.
This is worth at least a +4, and improves the diff on a number of other targets.