Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(fonts): swap Geist Sans → Inter with explicit CJK fallback

Naiyuan Qing4b10c9354a65
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index ad00504aad..b40377273c 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -22,8 +22,8 @@
"@dnd-kit/utilities": "^3.2.2",
"@electron-toolkit/preload": "^3.0.2",
"@electron-toolkit/utils": "^4.0.0",
+ "@fontsource-variable/inter": "^5.2.5",
"@fontsource/geist-mono": "^5.2.7",
- "@fontsource/geist-sans": "^5.2.5",
"@multica/core": "workspace:*",
"@multica/ui": "workspace:*",
"@multica/views": "workspace:*",
diff --git a/apps/desktop/src/renderer/src/globals.css b/apps/desktop/src/renderer/src/globals.css
index 4b4667800c..475efdf145 100644
--- a/apps/desktop/src/renderer/src/globals.css
+++ b/apps/desktop/src/renderer/src/globals.css
@@ -6,11 +6,27 @@
@custom-variant dark (&:is(.dark *));
-/* Geist font: define CSS variables that tokens.css @theme inline references.
- Web app gets these from next/font/google; desktop must set them explicitly. */
+/* Font stack: Inter for Latin UI text + system Chinese fonts for zh content.
+ Web app uses the same stack via next/font/google in apps/web/app/layout.tsx —
+ keep the CJK fallback tail in sync across both files. The Inter primary family
+ differs by design: next/font produces `__Inter_xxx` (with a synthetic size-adjusted
+ fallback face to prevent FOUT layout shift); desktop uses fontsource's "Inter Variable".
+ Both resolve to Inter glyphs, so rendering is identical in practice.
+ Currently covers English + Simplified Chinese. When ja/ko i18n lands, extend
+ the tail with Hiragino Kaku Gothic ProN / Yu Gothic / Apple SD Gothic Neo / Malgun Gothic.
+ Per-character fallback: Latin chars render with Inter, Chinese chars with
+ PingFang SC (macOS) / Microsoft YaHei (Windows) / Noto Sans CJK SC (Linux).
+
+ Mono font has no explicit CJK fallback: CJK chars in code blocks are inherently
+ non-aligned with a mono grid (Chinese is proportional), so listing CJK fonts
+ would falsely signal alignment guarantees. Browser default fallback handles
+ the rare mixed case correctly. */
:root {
- --font-sans: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
- --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
+ --font-sans: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont,
+ "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
+ sans-serif;
+ --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
+ monospace;
}
@source "../../../../../packages/ui/**/*.tsx";
diff --git a/apps/desktop/src/renderer/src/main.tsx b/apps/desktop/src/renderer/src/main.tsx
index 23513c95ad..ad276ee037 100644
--- a/apps/desktop/src/renderer/src/main.tsx
+++ b/apps/desktop/src/renderer/src/main.tsx
@@ -1,9 +1,9 @@
import ReactDOM from "react-dom/client";
import App from "./App";
-import "@fontsource/geist-sans/400.css";
-import "@fontsource/geist-sans/500.css";
-import "@fontsource/geist-sans/600.css";
-import "@fontsource/geist-sans/700.css";
+// Inter variable font covers all weights (100-900) in a single file.
+// Geist Mono kept as-is for code blocks; CJK is handled by system font fallback
+// (see globals.css --font-sans chain). Keep font stack in sync with apps/web/app/layout.tsx.
+import "@fontsource-variable/inter";
import "@fontsource/geist-mono/400.css";
import "@fontsource/geist-mono/700.css";
import "./globals.css";
diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx
index 2f9e0d2bc9..39573a3951 100644
--- a/apps/web/app/layout.tsx
+++ b/apps/web/app/layout.tsx
@@ -1,5 +1,5 @@
import type { Metadata, Viewport } from "next";
-import { Geist, Geist_Mono } from "next/font/google";
+import { Inter, Geist_Mono } from "next/font/google";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@multica/ui/components/ui/sonner";
import { cn } from "@multica/ui/lib/utils";
@@ -7,8 +7,38 @@ import { WebProviders } from "@/components/web-providers";
import { LocaleSync } from "@/components/locale-sync";
import "./globals.css";
-const geist = Geist({ subsets: ["latin"], variable: "--font-sans" });
-const geistMono = Geist_Mono({ subsets: ["latin"], variable: "--font-mono" });
+// Font stack: Inter for Latin UI text + system Chinese fonts for zh content.
+// Desktop app uses the same stack via apps/desktop/src/renderer/src/globals.css —
+// keep the CJK fallback tail in sync across both files. The Inter primary family
+// differs by design: next/font produces `__Inter_xxx` (with a synthetic size-adjusted
+// fallback face to prevent FOUT layout shift); desktop uses fontsource's "Inter Variable".
+// Both resolve to Inter glyphs, so rendering is identical in practice.
+// Currently covers English + Simplified Chinese. When ja/ko i18n lands, extend
+// the tail with Hiragino Kaku Gothic ProN / Yu Gothic / Apple SD Gothic Neo / Malgun Gothic.
+// Per-character fallback: Latin chars render with Inter, Chinese chars with
+// PingFang SC (macOS) / Microsoft YaHei (Windows) / Noto Sans CJK SC (Linux).
+const inter = Inter({
+ subsets: ["latin"],
+ variable: "--font-sans",
+ fallback: [
+ "-apple-system",
+ "BlinkMacSystemFont",
+ "Segoe UI",
+ "PingFang SC",
+ "Microsoft YaHei",
+ "Noto Sans CJK SC",
+ "sans-serif",
+ ],
+});
+// Mono font has no explicit CJK fallback: CJK chars in code blocks are inherently
+// non-aligned with a mono grid (Chinese is proportional), so listing CJK fonts
+// here would falsely signal alignment guarantees. Browser default fallback handles
+// the rare mixed case correctly.
+const geistMono = Geist_Mono({
+ subsets: ["latin"],
+ variable: "--font-mono",
+ fallback: ["ui-monospace", "SFMono-Regular", "Menlo", "Consolas", "monospace"],
+});
export const viewport: Viewport = {
width: "device-width",
@@ -59,7 +89,7 @@ export default function RootLayout({
<html
lang="en"
suppressHydrationWarning
- className={cn("antialiased font-sans h-full", geist.variable, geistMono.variable)}
+ className={cn("antialiased font-sans h-full", inter.variable, geistMono.variable)}
>
<body className="h-full overflow-hidden">
<LocaleSync />
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2c158ea77a..be20686597 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -108,12 +108,12 @@ importers:
'@electron-toolkit/utils':
specifier: ^4.0.0
version: 4.0.0([email protected])
+ '@fontsource-variable/inter':
+ specifier: ^5.2.5
+ version: 5.2.8
'@fontsource/geist-mono':
specifier: ^5.2.7
version: 5.2.7
- '@fontsource/geist-sans':
- specifier: ^5.2.5
- version: 5.2.5
'@multica/core':
specifier: workspace:*
version: link:../../packages/core
@@ -1297,12 +1297,12 @@ packages:
'@floating-ui/[email protected]':
resolution: {integrity: sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==}
+ '@fontsource-variable/[email protected]':
+ resolution: {integrity: sha512-kOfP2D+ykbcX/P3IFnokOhVRNoTozo5/JxhAIVYLpea/UBmCQ/YWPBfWIDuBImXX/15KH+eKh4xpEUyS2sQQGQ==}
+
'@fontsource/[email protected]':
resolution: {integrity: sha512-xVPVFISJg/K0VVd+aQN0Y7X/sw9hUcJPyDWFJ5GpyU3bHELhoRsJkPSRSHXW32mOi0xZCUQDOaPj1sqIFJ1FGg==}
- '@fontsource/[email protected]':
- resolution: {integrity: sha512-anllOHyJbElRs9fV15TeDRqAeb1IKm4bSknPl6ZMoyPTx1BBy7logudcUwpNjmQLkzn4Q0JGQLRCUKJYoyST6A==}
-
'@formatjs/[email protected]':
resolution: {integrity: sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==}
@@ -7488,9 +7488,9 @@ snapshots:
'@floating-ui/[email protected]': {}
- '@fontsource/[email protected]': {}
+ '@fontsource-variable/[email protected]': {}
- '@fontsource/[email protected]': {}
+ '@fontsource/[email protected]': {}
'@formatjs/[email protected]':
dependencies: