mirror of
https://github.com/aphrody-labs/vectorcraft.git
synced 2026-10-14 11:29:03 +00:00
Desktop builds made with CRAFT_FONTS_DIR now load craft-fonts' 12 Arabic families into the document font database. Noto Sans Arabic comes first and is the fallback for Arabic text. Cairo, Tajawal, Almarai, IBM Plex Sans Arabic, Noto Kufi Arabic, Amiri, Alexandria, Fustat, Reem Kufi, Aref Ruqaa and Gulzar can be picked by name from the font menus. The web build doesn't embed these fonts because they would make the wasm too large. It fetches them from beside the wasm instead: - crates/text/web-fonts.txt lists each face as startup or background. - build.rs turns that list into vectorcraft_text::WEB_FONTS, with each face's URL (fonts/<sha16>/<file>) and SRI hash taken from the craft-fonts manifest. - packaging/web/copy-fonts.sh, a Trunk post_build hook, copies the font files and their OFL licences there. - apps/vectorcraft-web/src/fonts.rs fetches Noto Sans Arabic before the app starts, so Arabic text never shows as boxes. It loads the other faces in the background and logs `web font …` for any that fail. Because fonts can now arrive after startup, the Type tool's layout cache also checks the font database's generation, so text lays out again when new fonts arrive. _headers and .htaccess serve fonts/* as font/ttf and cache it as immutable. packaging/web/README.md and docs/development.md explain the fonts folder, and ROADMAP.md lists the Arabic typefaces under Type. Also adds Ahmed Moussa to contributors/people.toml. Signed-off-by: Ahmed Moussa <moussa.ahmed95@gmail.com>
18 lines
414 B
Plaintext
18 lines
414 B
Plaintext
# Netlify / Cloudflare Pages header rules (see HOSTING.md). Other hosts: set the same headers.
|
|
/*
|
|
X-Content-Type-Options: nosniff
|
|
|
|
/*.wasm
|
|
Content-Type: application/wasm
|
|
Cache-Control: public, max-age=31536000, immutable
|
|
|
|
/*.js
|
|
Cache-Control: public, max-age=31536000, immutable
|
|
|
|
/index.html
|
|
Cache-Control: no-cache
|
|
|
|
/fonts/*
|
|
Content-Type: font/ttf
|
|
Cache-Control: public, max-age=31536000, immutable
|