(axis: VariableFontAxis)
| 36 | : `${axis.min}% ${axis.max}%`; |
| 37 | |
| 38 | export const formatSlantValue = (axis: VariableFontAxis): string => { |
| 39 | const min = Number(axis.min); |
| 40 | const max = Number(axis.max); |
| 41 | const minDegrees = Math.abs(min); |
| 42 | const maxDegrees = Math.abs(max); |
| 43 | |
| 44 | return min === max |
| 45 | ? `${minDegrees}deg` |
| 46 | : `${Math.min(minDegrees, maxDegrees)}deg ${Math.max(minDegrees, maxDegrees)}deg`; |
| 47 | }; |
| 48 | |
| 49 | export const findClosestWeight = (weights: number[], target = 400): number => { |
| 50 | if (weights.length === 0) return target; |
no outgoing calls
no test coverage detected