(axes: Record<string, number | undefined>)
| 19 | |
| 20 | // Generate font-variation-settings string from axes object e.g. "wght" 400, "wdth" 100 |
| 21 | const createFontVariation = (axes: Record<string, number | undefined>) => |
| 22 | Object.entries(axes) |
| 23 | .flatMap(([key, value]) => |
| 24 | value === undefined ? [] : [`"${key}" ${value}`], |
| 25 | ) |
| 26 | .join(', '); |
| 27 | |
| 28 | export { createFontVariation, type FontIDObject, type FontIDState }; |