(face: FontFace)
| 74 | }; |
| 75 | |
| 76 | const getCSSFiles = (face: FontFace): string[] => { |
| 77 | const style = formatStyle(face.style); |
| 78 | |
| 79 | if (face.isVariable) { |
| 80 | const axisKey = face.axisKey ?? 'wght'; |
| 81 | return [style === 'normal' ? `${axisKey}.css` : `${axisKey}-${style}.css`]; |
| 82 | } |
| 83 | |
| 84 | // Static packages publish both weight and subset entrypoints. |
| 85 | const assetFilenames = [ |
| 86 | style === 'normal' ? `${face.weight}.css` : `${face.weight}-${style}.css`, |
| 87 | `${face.subset}.css`, |
| 88 | ]; |
| 89 | |
| 90 | // Keep the legacy subset italic entrypoint. |
| 91 | if (style !== 'normal') { |
| 92 | assetFilenames.push(`${face.subset}-italic.css`); |
| 93 | } |
| 94 | |
| 95 | return assetFilenames; |
| 96 | }; |
| 97 | |
| 98 | export { |
| 99 | getCSSFiles, |
no test coverage detected