diff --git a/examples/astro/astro.config.mjs b/examples/astro/astro.config.mjs index 87386fd..269d06f 100644 --- a/examples/astro/astro.config.mjs +++ b/examples/astro/astro.config.mjs @@ -11,9 +11,32 @@ export default defineConfig({ custom: { display: 'swap', families: { - 'Dancing Script': './public/assets/fonts/DancingScript*', + 'Dancing Script': { + src: './public/assets/fonts/DancingScript*', + transform(font) { + if (font.basename === 'DancingScript-Bold') + font.weight = 700 + + return font + }, + }, }, }, + + fontsource: { + families: [ + { + name: 'ABeeZee', + weights: [400], + styles: ['italic'], + }, + { + name: 'Truculenta', + weights: [400, 700], + subset: 'latin-ext', + }, + ], + }, }), ], }) diff --git a/examples/astro/package.json b/examples/astro/package.json index e5db9e0..9d4f8bb 100644 --- a/examples/astro/package.json +++ b/examples/astro/package.json @@ -9,7 +9,9 @@ "astro": "astro" }, "devDependencies": { - "astro": "^2.1.3", + "@fontsource/abeezee": "^4.5.10", + "@fontsource/truculenta": "^4.5.12", + "astro": "^2.3.0", "unplugin-fonts": "workspace:*" } } diff --git a/examples/astro/src/pages/index.astro b/examples/astro/src/pages/index.astro index 8a6cf42..5374d0f 100644 --- a/examples/astro/src/pages/index.astro +++ b/examples/astro/src/pages/index.astro @@ -9,6 +9,8 @@ import Unfont from 'unplugin-fonts/astro/component.astro';