Skip to content

[glyphs-reader] Treat empty Axis Mappings custom parameter as absent#1961

Merged
anthrotype merged 1 commit intomainfrom
fix-1830-empty-axis-values
Apr 16, 2026
Merged

[glyphs-reader] Treat empty Axis Mappings custom parameter as absent#1961
anthrotype merged 1 commit intomainfrom
fix-1830-empty-axis-values

Conversation

@anthrotype
Copy link
Copy Markdown
Member

An empty "Axis Mappings" = {} custom parameter was being returned as Some(empty_BTreeMap), causing UserToDesignMapping::new() to use it as a valid (but empty) mapping and skip the instance-based fallback.

Fix: return None from user_to_design_from_axis_mapping() when the resulting map is empty, matching glyphsLib's behaviour of treating an empty dict as falsy.

Fixes #1830

An empty `"Axis Mappings" = {}` custom parameter was being returned as
`Some(empty_BTreeMap)`, causing `UserToDesignMapping::new()` to use it
as a valid (but empty) mapping and skip the instance-based fallback.

Fix: return `None` from `user_to_design_from_axis_mapping()` when the
resulting map is empty, matching glyphsLib's behaviour of treating an
empty dict as falsy.

Fixes #1830
Copy link
Copy Markdown
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@anthrotype anthrotype added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 8de9877 Apr 16, 2026
13 checks passed
@anthrotype anthrotype deleted the fix-1830-empty-axis-values branch April 16, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[glyphs] present but empty 'axis values' custom parameter causes miscompilation

2 participants