Fix font axes/features settings UI (#17164)

Due to #16821 everything about #16104 broke. This PR rights the wrongs
by rewriting all the `Font`-based code to not use `Font` at all.
Instead we split the font spec once into font families, do a lot of
complex logic to split font axes/features into used and unused ones
and construct all the UI elements. So. much. boilerplate. code.

Closes #16943

## Validation Steps Performed
There are more edge cases than I can list here... Some ideas:
* Edit the settings.json with invalid axis/feature keys 
* ...out of range values 
* Settings UI reloads when the settings.json changes 
* Adding axes/features works 
* Removing axes/features works 
* Resetting axes/features works 
* Axes/features apply in the renderer when saving 
This commit is contained in:
Leonard Hecker
2024-05-01 19:09:20 +02:00
committed by GitHub
parent 77087e6282
commit d3803943ca
22 changed files with 837 additions and 995 deletions

View File

@@ -349,7 +349,7 @@
"description": "Sets the DWrite font features for the given font. For example, { \"ss01\": 1, \"liga\":0 } will enable ss01 and disable ligatures.",
"type": "object",
"patternProperties": {
"^(([A-Za-z0-9]){4})$": {
"^[\\x20-\\x7E]{4}$": {
"type": "integer"
}
},
@@ -359,7 +359,7 @@
"description": "Sets the DWrite font axes for the given font. For example, { \"wght\": 200 } will set the font weight to 200.",
"type": "object",
"patternProperties": {
"^([A-Za-z]{4})$": {
"^[\\x20-\\x7E]{4}$": {
"type": "number"
}
},