[fonttools/fonttools] 10f311: Fix map_backward for many-to-one axis maps

1 view
Skip to first unread message

Cosimo Lupo

unread,
May 1, 2026, 10:19:25 AMMay 1
to fontto...@googlegroups.com
Branch: refs/heads/fix-map-backward-non-injective
Home: https://github.com/fonttools/fonttools
Commit: 10f3119b7ef075639892ee48bfdb2d8ffffa7e0f
https://github.com/fonttools/fonttools/commit/10f3119b7ef075639892ee48bfdb2d8ffffa7e0f
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-05-01 (Fri, 01 May 2026)

Changed paths:
M Lib/fontTools/designspaceLib/__init__.py

Log Message:
-----------
Fix map_backward for many-to-one axis maps

The old implementation inverted the axis map via a dict comprehension,
which silently dropped entries when multiple user-space values mapped
to the same design-space value (a flat segment in the avar sense).
This produced wrong interpolation for nearby design values, leading to
incorrect normalized coordinates for any code relying on map_backward.

Replace with a sorted list of (design, user) pairs that preserves both
endpoints of flat segments, so the inverse is correct on both sides.

https://github.com/googlefonts/ufo2ft/issues/978



To unsubscribe from these emails, change your notification settings at https://github.com/fonttools/fonttools/settings/notifications
Reply all
Reply to author
Forward
0 new messages