Commit f2142fc
feat(i18n): use Vazirmatn font for Persian locale (#1781)
* feat(i18n): use Vazirmatn font for Persian locale
* style: auto-format (ruff + oxfmt) [pre-commit.ci]
* perf(i18n): load only Vazirmatn's arabic subset for Persian
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).
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: giswqs <giswqs@gmail.com>1 parent c9b7e1a commit f2142fc
3 files changed
Lines changed: 58 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
30 | 73 | | |
31 | 74 | | |
32 | 75 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments