diff --git a/package.json b/package.json index f318f265..4533fe29 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "devDependencies": { "@eslint/compat": "^1.3.1", "@eslint/js": "^9.32.0", + "@fontsource/roboto": "^5.2.6", + "@fontsource/spectral": "^5.2.6", "@iconify/svelte": "^5.0.1", "@lucide/svelte": "^0.536.0", "@maiertech/sveltekit-helpers": "^0.29.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 135dd037..a871dde2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,12 @@ importers: '@eslint/js': specifier: ^9.32.0 version: 9.32.0 + '@fontsource/roboto': + specifier: ^5.2.6 + version: 5.2.6 + '@fontsource/spectral': + specifier: ^5.2.6 + version: 5.2.6 '@iconify/svelte': specifier: ^5.0.1 version: 5.0.1(svelte@5.37.2) @@ -311,6 +317,12 @@ packages: resolution: {integrity: sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@fontsource/roboto@5.2.6': + resolution: {integrity: sha512-hzarG7yAhMoP418smNgfY4fO7UmuUEm5JUtbxCoCcFHT0hOJB+d/qAEyoNjz7YkPU5OjM2LM8rJnW8hfm0JLaA==} + + '@fontsource/spectral@5.2.6': + resolution: {integrity: sha512-W1+UKOwcWMD3ykoInEi40h8zPIDjJcZOFX2yCUqci2tp0sGKRYlP4N6/Hzpa1SdFAfZnk3srl8paH4sO4qZMJQ==} + '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} @@ -2051,6 +2063,10 @@ snapshots: '@eslint/core': 0.15.1 levn: 0.4.1 + '@fontsource/roboto@5.2.6': {} + + '@fontsource/spectral@5.2.6': {} + '@humanfs/core@0.19.1': {} '@humanfs/node@0.16.6': diff --git a/src/app.css b/src/app.css index 3f90b158..ccd46b11 100644 --- a/src/app.css +++ b/src/app.css @@ -1,7 +1,24 @@ @import 'tailwindcss'; -@import './fonts/roboto/font.css' layer(utilities); -@import './fonts/spectral/font.css' layer(utilities); +/* Roboto: normal, medium, semibold, bold. */ +@import '@fontsource/roboto/latin-400-italic.css' layer(utilities); +@import '@fontsource/roboto/latin-400.css' layer(utilities); +@import '@fontsource/roboto/latin-500-italic.css' layer(utilities); +@import '@fontsource/roboto/latin-500.css' layer(utilities); +@import '@fontsource/roboto/latin-600-italic.css' layer(utilities); +@import '@fontsource/roboto/latin-600.css' layer(utilities); +@import '@fontsource/roboto/latin-700-italic.css' layer(utilities); +@import '@fontsource/roboto/latin-700.css' layer(utilities); + +/* Spectral: normal, medium, semibold, bold. */ +@import '@fontsource/spectral/latin-400-italic.css' layer(utilities); +@import '@fontsource/spectral/latin-400.css' layer(utilities); +@import '@fontsource/spectral/latin-500-italic.css' layer(utilities); +@import '@fontsource/spectral/latin-500.css' layer(utilities); +@import '@fontsource/spectral/latin-600-italic.css' layer(utilities); +@import '@fontsource/spectral/latin-600.css' layer(utilities); +@import '@fontsource/spectral/latin-700-italic.css' layer(utilities); +@import '@fontsource/spectral/latin-700.css' layer(utilities); @source '../node_modules/@maiertech/sveltekit-helpers/**/*.{js,svelte}'; diff --git a/src/fonts/roboto/font.css b/src/fonts/roboto/font.css deleted file mode 100644 index 7043480b..00000000 --- a/src/fonts/roboto/font.css +++ /dev/null @@ -1,96 +0,0 @@ -@font-face { - font-family: 'Roboto'; - font-style: normal; - font-display: swap; - font-weight: 100; - src: url(./roboto-v32-latin-100.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: italic; - font-display: swap; - font-weight: 100; - src: url(./roboto-v32-latin-100italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: normal; - font-display: swap; - font-weight: 300; - src: url(./roboto-v32-latin-300.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: italic; - font-display: swap; - font-weight: 300; - src: url(./roboto-v32-latin-300italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: normal; - font-display: swap; - font-weight: 400; - src: url(./roboto-v32-latin-regular.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: italic; - font-display: swap; - font-weight: 400; - src: url(./roboto-v32-latin-italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: normal; - font-display: swap; - font-weight: 500; - src: url(./roboto-v32-latin-500.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: italic; - font-display: swap; - font-weight: 500; - src: url(./roboto-v32-latin-500italic.woff2) format('woff2'); -} - -/* roboto-latin-700-normal */ -@font-face { - font-family: 'Roboto'; - font-style: normal; - font-display: swap; - font-weight: 700; - src: url(./roboto-v32-latin-700.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: italic; - font-display: swap; - font-weight: 700; - src: url(./roboto-v32-latin-700italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: normal; - font-display: swap; - font-weight: 900; - src: url(./roboto-v32-latin-900.woff2) format('woff2'); -} - -@font-face { - font-family: 'Roboto'; - font-style: italic; - font-display: swap; - font-weight: 900; - src: url(./roboto-v32-latin-900italic.woff2) format('woff2'); -} diff --git a/src/fonts/roboto/roboto-v32-latin-100.woff2 b/src/fonts/roboto/roboto-v32-latin-100.woff2 deleted file mode 100644 index b0016470..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-100.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-100italic.woff2 b/src/fonts/roboto/roboto-v32-latin-100italic.woff2 deleted file mode 100644 index c27d97f3..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-100italic.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-300.woff2 b/src/fonts/roboto/roboto-v32-latin-300.woff2 deleted file mode 100644 index 72226f5d..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-300.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-300italic.woff2 b/src/fonts/roboto/roboto-v32-latin-300italic.woff2 deleted file mode 100644 index 83874b7b..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-300italic.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-500.woff2 b/src/fonts/roboto/roboto-v32-latin-500.woff2 deleted file mode 100644 index 88c17734..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-500.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-500italic.woff2 b/src/fonts/roboto/roboto-v32-latin-500italic.woff2 deleted file mode 100644 index 21a36192..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-500italic.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-700.woff2 b/src/fonts/roboto/roboto-v32-latin-700.woff2 deleted file mode 100644 index 22f6f53c..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-700.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-700italic.woff2 b/src/fonts/roboto/roboto-v32-latin-700italic.woff2 deleted file mode 100644 index 851fedb9..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-700italic.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-900.woff2 b/src/fonts/roboto/roboto-v32-latin-900.woff2 deleted file mode 100644 index bd6794f0..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-900.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-900italic.woff2 b/src/fonts/roboto/roboto-v32-latin-900italic.woff2 deleted file mode 100644 index 70deed03..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-900italic.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-italic.woff2 b/src/fonts/roboto/roboto-v32-latin-italic.woff2 deleted file mode 100644 index 9dc0be83..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-italic.woff2 and /dev/null differ diff --git a/src/fonts/roboto/roboto-v32-latin-regular.woff2 b/src/fonts/roboto/roboto-v32-latin-regular.woff2 deleted file mode 100644 index 2d7b2151..00000000 Binary files a/src/fonts/roboto/roboto-v32-latin-regular.woff2 and /dev/null differ diff --git a/src/fonts/spectral/font.css b/src/fonts/spectral/font.css deleted file mode 100644 index 7ec5fd97..00000000 --- a/src/fonts/spectral/font.css +++ /dev/null @@ -1,111 +0,0 @@ -@font-face { - font-family: 'Spectral'; - font-style: normal; - font-display: swap; - font-weight: 200; - src: url(./spectral-v14-latin-200.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: italic; - font-display: swap; - font-weight: 200; - src: url(./spectral-v14-latin-200italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: normal; - font-display: swap; - font-weight: 300; - src: url(./spectral-v14-latin-300.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: italic; - font-display: swap; - font-weight: 300; - src: url(./spectral-v14-latin-300italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: normal; - font-display: swap; - font-weight: 400; - src: url(./spectral-v14-latin-regular.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: italic; - font-display: swap; - font-weight: 400; - src: url(./spectral-v14-latin-italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: normal; - font-display: swap; - font-weight: 500; - src: url(./spectral-v14-latin-500.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: italic; - font-display: swap; - font-weight: 500; - src: url(./spectral-v14-latin-500italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: normal; - font-display: swap; - font-weight: 600; - src: url(./spectral-v14-latin-600.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: italic; - font-display: swap; - font-weight: 600; - src: url(./spectral-v14-latin-600italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: normal; - font-display: swap; - font-weight: 700; - src: url(./spectral-v14-latin-700.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: italic; - font-display: swap; - font-weight: 700; - src: url(./spectral-v14-latin-700italic.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: normal; - font-display: swap; - font-weight: 800; - src: url(./spectral-v14-latin-800.woff2) format('woff2'); -} - -@font-face { - font-family: 'Spectral'; - font-style: italic; - font-display: swap; - font-weight: 800; - src: url(./spectral-v14-latin-800italic.woff2) format('woff2'); -} diff --git a/src/fonts/spectral/spectral-v14-latin-200.woff2 b/src/fonts/spectral/spectral-v14-latin-200.woff2 deleted file mode 100644 index 61489a3d..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-200.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-200italic.woff2 b/src/fonts/spectral/spectral-v14-latin-200italic.woff2 deleted file mode 100644 index 35fad944..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-200italic.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-300.woff2 b/src/fonts/spectral/spectral-v14-latin-300.woff2 deleted file mode 100644 index 8d12931f..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-300.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-300italic.woff2 b/src/fonts/spectral/spectral-v14-latin-300italic.woff2 deleted file mode 100644 index f9b0676f..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-300italic.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-500.woff2 b/src/fonts/spectral/spectral-v14-latin-500.woff2 deleted file mode 100644 index 440edbb7..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-500.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-500italic.woff2 b/src/fonts/spectral/spectral-v14-latin-500italic.woff2 deleted file mode 100644 index feea3af0..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-500italic.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-600.woff2 b/src/fonts/spectral/spectral-v14-latin-600.woff2 deleted file mode 100644 index 3f56161f..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-600.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-600italic.woff2 b/src/fonts/spectral/spectral-v14-latin-600italic.woff2 deleted file mode 100644 index 359f1f25..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-600italic.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-700.woff2 b/src/fonts/spectral/spectral-v14-latin-700.woff2 deleted file mode 100644 index 615536f5..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-700.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-700italic.woff2 b/src/fonts/spectral/spectral-v14-latin-700italic.woff2 deleted file mode 100644 index c0794fe8..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-700italic.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-800.woff2 b/src/fonts/spectral/spectral-v14-latin-800.woff2 deleted file mode 100644 index 62dbd7c0..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-800.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-800italic.woff2 b/src/fonts/spectral/spectral-v14-latin-800italic.woff2 deleted file mode 100644 index fd86e05d..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-800italic.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-italic.woff2 b/src/fonts/spectral/spectral-v14-latin-italic.woff2 deleted file mode 100644 index 1e0f3832..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-italic.woff2 and /dev/null differ diff --git a/src/fonts/spectral/spectral-v14-latin-regular.woff2 b/src/fonts/spectral/spectral-v14-latin-regular.woff2 deleted file mode 100644 index 71700f80..00000000 Binary files a/src/fonts/spectral/spectral-v14-latin-regular.woff2 and /dev/null differ diff --git a/src/hooks.server.ts b/src/hooks.server.ts new file mode 100644 index 00000000..ae282432 --- /dev/null +++ b/src/hooks.server.ts @@ -0,0 +1,14 @@ +import type { Handle } from '@sveltejs/kit'; + +export const handle: Handle = async ({ event, resolve }) => { + // Preload web fonts. + const response = await resolve(event, { + preload: ({ type, path }) => { + if (type === 'font') { + return path.endsWith('.woff2'); + } + return false; + } + }); + return response; +};