10 Commits

Author SHA1 Message Date
Behdad Esfahbod
54cfb5f696 [designspaceLib/avar2] Err if mappings axes ranges are being subset 2023-06-01 12:24:51 -06:00
Behdad Esfahbod
ddf16c9130 [designspaceLib/avar2] Apply review comments 2023-06-01 11:54:43 -06:00
Behdad Esfahbod
ca642e89c4 [designspaceLib/avar2] First stab at splitting mappings 2023-05-30 23:03:33 -06:00
Behdad Esfahbod
0b57567c14 [designspaceLib/avar2] Add AxisMappingDescriptor 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
be9dacad74 [designspaceLib/avar2] Rename mapping to axisMappings 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
50fc8218b3 [designspace/varLib] Hack to read avar2 mapping and build avar2 table
This just uses list of list of dictionaries. Should use proper objects.

https://github.com/fonttools/fonttools/issues/3049

https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2-in-designspace.md
2023-05-28 15:14:25 -06:00
Harry Dalton
2da2653837 Allow "minimum"/"maximum" keys to be missing, as well as None
Some areas of the library check for both representations, and so doing
this here too means we are less likely to break existing code.

Despite this, flexibility introduces ambiguity, and so if typing gives
us confidence that such an input is unlikely, we could re-review this;
conditions with missing keys are not safe to use across the entire code-
base.
2022-09-01 17:21:04 +01:00
Harry Dalton
fef9e9a071 Fix handling of unbounded conditions
For unbounded conditions, the previous code expects "minimum" or
"maximum" to be entirely absent, whereas actually they will be
consistently present with one having a value of None.

This means that math.inf and -math.inf are never substituted in for the
absent bound, and a crash occurs when the None value propagates.

This commit corrects the behaviour by checking for a value of None,
instead of checking for the presence of the keys, bringing the
behaviour inline with the rest of the library.
2022-09-01 13:49:58 +01:00
Jany Belluz
ec4bcf54c9 Check for descriptor types with hasattr() to allow custom classes that don't inherit the default descriptors 2022-06-01 12:00:52 +01:00
Jany Belluz
35e560603e [designspaceLib] Add designspace 5 code 2022-04-14 15:03:58 +01:00