diff --git a/apps/geolibre-desktop/package.json b/apps/geolibre-desktop/package.json index ddef308329..67494d68dc 100644 --- a/apps/geolibre-desktop/package.json +++ b/apps/geolibre-desktop/package.json @@ -31,6 +31,8 @@ "@dvt3d/maplibre-three-plugin": "^1.7.1", "@electric-sql/pglite": "^0.5.4", "@electric-sql/pglite-postgis": "^0.2.4", + "@fontsource-variable/ibm-plex-sans": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@geolibre/core": "*", "@geolibre/embed": "*", "@geolibre/map": "*", diff --git a/apps/geolibre-desktop/src/index.css b/apps/geolibre-desktop/src/index.css index 4483c6a387..800505c3b8 100644 --- a/apps/geolibre-desktop/src/index.css +++ b/apps/geolibre-desktop/src/index.css @@ -1,9 +1,32 @@ @import "@geolibre/ui/globals.css"; + /* Supplies the custom-color/border-radius theme that @geolibre/ui's globals.css relies on via @apply (background, border, etc.). globals.css is intentionally config-agnostic; the consuming app provides the Tailwind config here. */ @config "../tailwind.config.js"; +/* App typeface: IBM Plex Sans for UI, IBM Plex Mono for the numeric/coordinate + readouts (StatusBar, code, feature IDs). One matched superfamily, so the mono + readouts and the surrounding UI share a voice. The @font-face rules are + loaded from main.tsx — see the note there for why they cannot be @imported + here. Self-hosted rather than CDN-loaded: the desktop build must render + offline, and the Tauri CSP is `default-src 'self'`. + + This block drives both the `font-sans`/`font-mono` utilities and Tailwind's + preflight default, so no `font-family` on
is needed. + + Plex covers latin, latin-ext, cyrillic, greek and vietnamese only. The + locales it does NOT cover (ar, fa, hi, ja, ka, ko, th, zh) rely on per-glyph + fallback to the system stack below — which is why that stack must stay a + full, ordered list rather than a bare `sans-serif`. */ +@theme { + --font-sans: + "IBM Plex Sans Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, + "Noto Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + --font-mono: + "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; +} + html, body, #root { diff --git a/apps/geolibre-desktop/src/main.tsx b/apps/geolibre-desktop/src/main.tsx index bf94071561..e557c2dc7b 100644 --- a/apps/geolibre-desktop/src/main.tsx +++ b/apps/geolibre-desktop/src/main.tsx @@ -1,6 +1,16 @@ import "./lib/symbol-dispose-polyfill"; import React from "react"; import ReactDOM from "react-dom/client"; +/* App typeface — see the --font-sans/--font-mono note in index.css. + These must be imported from JS, not via `@import` in index.css: Tailwind v4 + resolves CSS @imports itself and inlines them before Vite sees them, so the + relative `url(./files/*.woff2)` in fontsource's CSS is never rewritten into + an asset reference and no font file is emitted into dist/. The result builds + clean and 404s at runtime, silently falling back to system fonts. Importing + from JS routes the CSS through Vite's asset pipeline instead. */ +import "@fontsource-variable/ibm-plex-sans/wght.css"; +import "@fontsource/ibm-plex-mono/400.css"; +import "@fontsource/ibm-plex-mono/700.css"; import "@geoman-io/maplibre-geoman-free/dist/maplibre-geoman.css"; import "@maplibre/maplibre-gl-directions/dist/style.css"; import "maplibre-gl-3d-tiles/style.css"; diff --git a/package-lock.json b/package-lock.json index 56ec9704d3..00072aaebe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,8 @@ "@dvt3d/maplibre-three-plugin": "^1.7.1", "@electric-sql/pglite": "^0.5.4", "@electric-sql/pglite-postgis": "^0.2.4", + "@fontsource-variable/ibm-plex-sans": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@geolibre/core": "*", "@geolibre/embed": "*", "@geolibre/map": "*", @@ -3876,6 +3878,24 @@ "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==", "license": "MIT" }, + "node_modules/@fontsource-variable/ibm-plex-sans": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/ibm-plex-sans/-/ibm-plex-sans-5.3.0.tgz", + "integrity": "sha512-agG8tXFEo0hD9+J7npa4vbbWult52eMLVaQ6WQRlhs/iCAojrMAoejru85W9HTVXHfyUj96KM7gp/KGAS87XaQ==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/ibm-plex-mono": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/ibm-plex-mono/-/ibm-plex-mono-5.3.0.tgz", + "integrity": "sha512-eTgnZjZEGk1QtD3ZstF+Vclo2HLAni8YMy34/DxllwZvyz1lR/1RF/xTiAquOBO7MvqBx8D2Ig2WCPMVfdZu7Q==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@geoarrow/deck.gl-geoarrow": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@geoarrow/deck.gl-geoarrow/-/deck.gl-geoarrow-0.4.1.tgz", diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx index 58a7184034..61c7620992 100644 --- a/packages/ui/src/components/dialog.tsx +++ b/packages/ui/src/components/dialog.tsx @@ -37,7 +37,7 @@ export const DialogContent = React.forwardRef<