feat(i18n): use Vazirmatn font for Persian locale - #1781
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe desktop app adds the Vazirmatn Variable package, defines an offline Arabic-subset font face, and applies a Persian-specific font stack while retaining IBM Plex Sans and system fallbacks. ChangesPersian Font Support
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.6)apps/geolibre-desktop/src/index.cssFile contains syntax errors that prevent linting: Line 6: Tailwind-specific syntax is disabled.; Line 22: Tailwind-specific syntax is disabled.; Line 102: Tailwind-specific syntax is disabled.; Line 138: Tailwind-specific syntax is disabled. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/claude-review |
🔍 Cloudflare PR preview
|
| html:lang(fa) { | ||
| --font-sans: | ||
| "Vazirmatn Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, | ||
| "Noto Sans Arabic", "Noto Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", | ||
| "Segoe UI Emoji"; | ||
| } |
There was a problem hiding this comment.
Minor doc drift: the block comment above (lines 18-21) says the locales Plex doesn't cover, including fa, "rely on per-glyph fallback to the system stack below." That's no longer true for fa once this override is in place — it now gets Vazirmatn instead of falling back. Worth updating that comment (e.g. "except fa, which uses Vazirmatn below") so it doesn't mislead the next reader about which locales are still on system fallback.
Confidence: medium.
Code reviewBugs: None found. The Security: None found. Font is self-hosted (consistent with existing IBM Plex Sans handling and the Tauri CSP's Performance: None found. Adds one additional self-hosted variable font import, following the exact same Quality:
CLAUDE.md: No violations found. Dependency added in the correct alphabetical position in |
🔍 GitHub Pages PR preview
Note GitHub Pages built this preview successfully, but its serving edge returned HTTP 403 when checked. The links may still be propagating. |
|
Nice fix — Persian genuinely had no glyph coverage before this. One suggestion on the bundle cost, with numbers from building The cost today
Whole- The part worth flagging is the service worker: the three files land in the Workbox precache manifest, which goes from 458 entries / 15,707.43 KiB to 461 / 15,809.35 KiB — +101.92 KiB. Precaching fetches every entry on SW install, so this isn't lazy per- Suggestion: load only the Arabic subsetPersian only needs the There's no subset-scoped entry point to import (the package publishes only @font-face {
font-family: "Vazirmatn Variable";
font-style: normal;
font-display: swap;
font-weight: 100 900;
src: url("@fontsource-variable/vazirmatn/files/vazirmatn-arabic-wght-normal.woff2")
format("woff2-variations");
unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}( I built this variant to check it against the Tailwind v4 hazard documented above the font imports in
Saves 57,985 B of shipped assets and 56.48 KiB of precache. One thing to pair with itThe --font-sans:
"Vazirmatn Variable", "IBM Plex Sans", ui-sans-serif, system-ui, …;That arguably makes Persian more consistent with every other locale than the current version does, on top of being smaller. |
Importing @fontsource-variable/vazirmatn/wght.css pulled in all three of the font's subsets — arabic (46,308 B), latin (34,524 B) and latin-ext (21,860 B). The two Latin subsets duplicate coverage IBM Plex Sans already provides, and because every emitted asset lands in the Workbox precache manifest, they were not lazily fetched per unicode-range: the service worker downloaded all three on install for every user, whatever their locale. Fontsource publishes no subset-scoped entry point (index.css and wght.css both declare all three), so declare the @font-face by hand against the package's exported ./files/*.woff2. The Tailwind-inlining hazard documented in main.tsx does not apply — that one is specific to @importing fontsource's own CSS, whose relative url(./files/*.woff2) never reaches Vite's asset pipeline. Also add IBM Plex Sans to the fa stack, after Vazirmatn. Without the Latin subsets the Latin text that remains in a Persian UI (layer names, coordinates, product names) would drop to system-ui; this keeps it on the same typeface as every other locale, at no extra bytes since Plex is already loaded. dist delta vs main: +105,462 B -> +48,007 B. Precache: +101.92 KiB (3 entries) -> +45.95 KiB (1 entry).
|
Pushed this to the branch as Verified in a real browser against the production build (
|
Summary
Use Vazirmatn as the UI font for the Persian (
fa) locale.IBM Plex Sans does not provide Persian glyph coverage, so Persian text currently falls back to the system font. This change adds Vazirmatn as a self-hosted font and applies it only when the active locale is Persian.
Changes
@fontsource-variable/vazirmatnfa) localeTesting
npm run build -w geolibre-desktop✅Summary by CodeRabbit