Skip to content

Embed Noto Sans Arabic in the web build so Arabic text is not boxes - #2829

Open
m7md1418 wants to merge 1 commit into
storytold:mainfrom
m7md1418:web-arabic-font
Open

m7md1418 wants to merge 1 commit into
storytold:mainfrom
m7md1418:web-arabic-font

Conversation

@m7md1418

@m7md1418 m7md1418 commented Oct 28, 2026 •

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Arabic script rendering is now supported through Noto Sans Arabic Regular.
    • The Arabic font is permitted in web builds.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 55b5a45 and 74330c0.

Files selected for processing: 3
  • crates/ui-egui/src/craft_fonts_policy.rs
  • crates/ui-egui/src/theme/tests.rs
  • crates/ui-egui/tests/it/symbol_glyphs.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The craft-font policy adds Noto Sans Arabic Regular, tagged Arab, to the required faces and web allowlist. The policy and integration tests update their expected face lists, and an integration-test comment clarifies the native-build face set.

Changes: Arabic font coverage

Layer / File(s) Summary
Add Arabic face to font policy and tests
crates/ui-egui/src/craft_fonts_policy.rs, crates/ui-egui/src/theme/tests.rs, crates/ui-egui/tests/it/symbol_glyphs.rs
The required-face list and web allowlist include Noto Sans Arabic Regular with the Arab script tag. The policy and integration tests expect the added face. A comment clarifies the native-build permitted-face set.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Possibly related issues

Suggested reviewers: skylartaylor, aiongg

Merge Risk: Minimal · up to 74330

No actionable merge-blocking risk is evident; the Arabic font policy change is internally consistent.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding Noto Sans Arabic to the web build to prevent missing Arabic glyphs.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 3 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Harrison-Booth

Copy link
Copy Markdown
Contributor

Review checks on head 74330c0:

  • cargo fmt --check passed.
  • On Windows, cargo test -p gridcraft-ui-egui craft_fonts_policy::tests passed (8 tests), and cargo test -p gridcraft-ui-egui --test it symbol_glyphs:: passed (7 tests).
  • Both test runs used the optional-font mode with CRAFT_FONTS_DIR absent. The strict required-font acceptance run with the pinned craft-fonts checkout was unavailable here. Source inspection confirms the Arabic entry is Noto Sans Arabic / Regular with the exact Arab script tag, and it is added to the explicit web allowlist. No font asset is added to GridCraft.

Thai could land first. Arabic then needs the Thai and Arabic entries combined in REQUIRED_FACES, WEB_ALLOWED, the exact allowlist test, theme/tests.rs, and the required-face expectations/comment in symbol_glyphs.rs; both PRs edit those same insertion hunks. The Arabic PR alone does not add files outside the existing policy/test files.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReviewerA — source-read COMMENT (not an approval)

I read the whole diff: Noto Sans Arabic (Regular, script Arab) is added to REQUIRED_FACES and WEB_ALLOWED, with the policy test and symbol-glyph test updated. craft-fonts' manifest does list that face with script Arab, so the required-face check can be satisfied. The comment states about 845 KB added to the wasm bundle; please confirm the web size gate still passes (and its budget), and that the fonts pin used by the build includes that face. Not run; no exact-head CI result.

I ran nothing and have no exact-head CI result for this PR, so this is not an approval.

Status: waiting_author.

@m7md1418

m7md1418 commented Nov 1, 2026

Copy link
Copy Markdown
Author

Thanks for the review. I checked both points locally on 74330c0.

Fonts pin: ci.yml and release.yml pin craft-fonts-ref to b076417b. Its fonts/manifest.txt lists "Noto Sans Arabic | Regular | ... | Arab", and the file's sha256 matches the manifest (63111b5b...), 844,676 bytes. The web build also passes with CRAFT_FONTS_REQUIRED=1, which fails when a listed face is missing.

Web size: I couldn't find an automated size gate or a budget number in xtask or in craft-common-actions; docs/egui-037-local-followups.md:166 says the size is not measured yet. So I measured it with trunk build --release in apps/gridcraft-web (CRAFT_FONTS_DIR at b076417b), before = 55b5a45, after = 74330c0:

  • _bg.wasm raw: 34,330,179 B -> 35,171,395 B (+841,216 B, +2.45%)
  • gzip -9: 15,357,988 B -> 15,812,602 B (+454,614 B, +2.96%)

The raw delta is about the size of the font file, so nothing else changed. If you'd like a budget enforced, I'm happy to add a check with a number you pick.

One note: release.yml doesn't pass web-craft-fonts: true today, so the released web build doesn't embed craft-fonts yet. This change shows up in release builds once that input is turned on.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants