Allowed customizing menu WWS value to name map (#2488). (#2535)

This commit is contained in:
Belleve 2024-10-06 12:32:42 -10:00 committed by GitHub
parent b5acd21122
commit 4d19a20610
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 70 additions and 23 deletions

View file

@ -3634,8 +3634,29 @@ The properties in the `namingOverride` section could be uase to override menu na
- `urlDesigner`: Name ID 12, URL of typeface designer.
- `license` (or alternatively `licence`): Name ID 13, license description.
- `licenseURL` (or alternatively `licenceURL`): Name ID 14, license Info URL.
- `version`: Override font version. The version number should follow [SemVer](https://semver.org/), like being `1.0.0`.
In addition, you can also use the `version` property to override font version. The version number should follow [SemVer](https://semver.org/), like being `1.0.0`.
Additionally, the `namingOverride` section now supports a `menuNameMap` configuration property. This property allows for the customization of menu names based on specific attributes related to the font's style and characteristics. The `menuNameMap` configuration is structured as follows:
- `weight`: A mapping of menu weight numbers to their corresponding names.
- `width`: A mapping of menu width numbers to their corresponding names.
- `slope`: A mapping of menu slope values (`"normal"`/`"italic"`/`"oblique"`) to their corresponding names.
- `weightShort`: A mapping of menu weight numbers to short names.
- `widthShort`: A mapping of menu width numbers to short names.
- `slopeShort`: A mapping of menu slope values (`"normal"`/`"italic"`/`"oblique"`) to short names.
You are allowed to provide override names only for the values that you want to have custom names. Any values not specified in these mappings will use the default names.
For example, the following configuration:
```toml
[buildPlans.IosevkaCustom.namingOverride.menuNameMap.width]
7 = "Expanded"
[buildPlans.IosevkaCustom.namingOverride.menuNameMap.widthShort]
7 = "Exp"
```
... will name width 7 to "Expanded" in full, and "Exp" in short.
#### Sample Configuration