Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

refactor(ui): manage Cloud fonts with Nuxt Fonts

Timothy Yind23822338274
diff --git a/apps/cloud/app/assets/cloud.css b/apps/cloud/app/assets/cloud.css
index 19196a55..ed091c0f 100644
--- a/apps/cloud/app/assets/cloud.css
+++ b/apps/cloud/app/assets/cloud.css
@@ -65,14 +65,6 @@
color: var(--accent);
font-weight: 400;
}
-@font-face {
- font-family: 'Ma Shan Zheng';
- src: url('/fonts/ma-shan-zheng/story.ttf') format('truetype');
- font-weight: 400;
- font-style: normal;
- font-display: swap;
- unicode-range: U+3002, U+4E8B, U+4F60, U+6545, U+7684;
-}
.cf-hero-title em.cf-hero-story-zh {
font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
font-style: normal;
diff --git a/apps/cloud/nuxt.config.ts b/apps/cloud/nuxt.config.ts
index 35241298..efc7c3c7 100644
--- a/apps/cloud/nuxt.config.ts
+++ b/apps/cloud/nuxt.config.ts
@@ -7,7 +7,30 @@ const galleryPages = fileURLToPath(
)
export default defineNuxtConfig({
...sharedUi,
- modules: sharedUi.modules,
+ modules: [...sharedUi.modules, '@nuxt/fonts'],
+ fonts: {
+ provider: 'local',
+ defaults: { preload: false },
+ families: [
+ {
+ name: 'Ma Shan Zheng',
+ src: '/fonts/ma-shan-zheng/story.ttf',
+ weight: 400,
+ style: 'normal',
+ display: 'swap',
+ fallbacks: [],
+ preload: false,
+ },
+ // Preserve the existing device font stacks and English slogan typography.
+ ...[
+ 'Inter',
+ 'Noto Sans SC',
+ 'Noto Serif SC',
+ 'Georgia',
+ 'Times New Roman',
+ ].map((name) => ({ name, provider: 'none' as const })),
+ ],
+ },
i18n: {
strategy: 'no_prefix',
defaultLocale: 'en',
diff --git a/apps/cloud/package.json b/apps/cloud/package.json
index fa02160a..3ebecd47 100644
--- a/apps/cloud/package.json
+++ b/apps/cloud/package.json
@@ -21,6 +21,7 @@
"@chronoframe/platform": "workspace:*",
"@chronoframe/saas-ui": "workspace:*",
"@chronoframe/storage": "workspace:*",
+ "@nuxt/fonts": "0.14.0",
"@nuxt/icon": "2.5.1",
"@nuxt/ui": "^4.11.3",
"@nuxtjs/color-mode": "4.0.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ba6687dc..de310309 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -296,6 +296,9 @@ importers:
'@chronoframe/storage':
specifier: workspace:*
version: link:../../packages/storage
+ '@nuxt/fonts':
+ specifier: 0.14.0
'@nuxt/icon':
specifier: 2.5.1