(axis: VariableFontAxis)
| 36 | : `${axis.min}% ${axis.max}%`; |
| 37 | |
| 38 | export const formatSlantValue = (axis: VariableFontAxis): string => { |
| 39 | // OpenType slnt and CSS oblique use opposite signs; reverse the endpoints too. |
| 40 | const min = Number(axis.min); |
| 41 | const max = Number(axis.max); |
| 42 | const minDegrees = -max; |
| 43 | const maxDegrees = -min; |
| 44 | |
| 45 | return min === max ? `${minDegrees}deg` : `${minDegrees}deg ${maxDegrees}deg`; |
| 46 | }; |
| 47 | |
| 48 | export const findClosestWeight = (weights: number[], target = 400): number => { |
| 49 | if (weights.length === 0) return target; |
no outgoing calls
no test coverage detected