fonts: embed craft-fonts' Indian-script faces; the web build draws Indian text

ui-egui's build.rs reads the optional craft-fonts input (CRAFT_FONTS_DIR,
per craft-fonts' docs/integration.md) and embeds the Noto Sans faces for
the nine Indian scripts (Deva, Beng, Guru, Gujr, Orya, Taml, Telu, Knda,
Mlym; ~5 MB) on every target. The theme appends them after the system
faces, so desktop rendering is unchanged where a system face exists and
the web build, which has no system fonts, draws and shapes Indian text.
Language::script() names each interface's script; the web build follows
the browser's language when the build can render it.

CI checks the embedded faces against a pinned craft-fonts commit (the
Noto Sans Indian faces, storytold/craft-fonts#21): they draw and shape
every script with no system face, and the web build compiles with them.
FreeBSD and release workflows pin the same commit. A plain build is
unchanged (empty table, same tests pass).
This commit is contained in:
kulveersingh
2026-10-12 02:08:04 -04:00
parent fd63fe1bed
commit bc3aab900f
12 changed files with 221 additions and 31 deletions
+18
View File
@@ -46,3 +46,21 @@ jobs:
- name: Quality gate
run: cargo xtask ci
# The optional craft-fonts build input (CRAFT_FONTS_DIR): the Indian-script faces the web build
# embeds. The gate above runs without it; this checks the embedded faces draw and shape Indian
# text with no system faces, and that the web build compiles with them.
- name: Check out craft-fonts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: storytold/craft-fonts
ref: d47f68570a43b364afcd832d00c297a9edea6932
path: craft-fonts
- name: Embedded craft-fonts faces
env:
CRAFT_FONTS_DIR: ${{ github.workspace }}/craft-fonts
CRAFT_FONTS_REQUIRED: "1"
run: |
cargo test -p gridcraft-ui-egui --lib theme::
cargo check --target wasm32-unknown-unknown -p gridcraft-web
+1 -1
View File
@@ -56,7 +56,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: storytold/craft-fonts
ref: abb83316d96aa59c1cf64784289e378fe9fa5695
ref: d47f68570a43b364afcd832d00c297a9edea6932
path: craft-fonts
- name: Build in a FreeBSD VM
uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc # v1.5.9
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
with:
app-name: gridcraft
app-title: GridCraft
craft-fonts-ref: abb83316d96aa59c1cf64784289e378fe9fa5695
craft-fonts-ref: d47f68570a43b364afcd832d00c297a9edea6932
version: ${{ inputs.version }}
secrets:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}