(family: string, face: FontFace)
| 36 | }; |
| 37 | |
| 38 | const getFaceComment = (family: string, face: FontFace): string => { |
| 39 | const axisOrWeight = |
| 40 | typeof face.axisKey === 'string' ? face.axisKey.toLowerCase() : face.weight; |
| 41 | |
| 42 | let comment = `${normalizeKebabCase(family)}-${face.subset}-${axisOrWeight}-${formatStyle(face.style)}`; |
| 43 | |
| 44 | if (face.sliceIndex > 0) { |
| 45 | comment += `-${face.sliceIndex}`; |
| 46 | } |
| 47 | |
| 48 | return comment; |
| 49 | }; |
| 50 | |
| 51 | // Variable fonts get a "Variable" suffix in their family name to avoid conflicts with static faces. |
| 52 | // We need it when variable fonts are included and static files are present as a fallback. |
no test coverage detected