base: Bundle IBM Plex Sans so the web examples resolve .SystemUIFont - #3235
Merged
Merged
Conversation
Since #3128 every "Rust & WASM" example under /base/ on the website came up blank, with the console full of "RefCell already borrowed". The first error is a panic in TextSystem::resolve_font: the examples' root font became `.SystemUIFont`, gpui-pre-web resolves that alias to "IBM Plex Sans" and starts with an empty font database, so the first text layout panicked and the canvas never painted. The bundled Inter no longer matched anything. Bundle the existing IBM Plex Sans subset from crates/story-web/fonts instead of Inter for the web build (the same fix #2933 applied to the gallery), and let subset-fonts.py scan the motion example too so its text stays covered. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since #3128 every "Rust & WASM" example under
/base/(motion, button, dialog, …) came up blank on the website, with the console full ofRefCell already borrowed. The first error is a panic inTextSystem::resolve_font:#3128 switched the examples' root font from
Inter Variableto.SystemUIFontso the native binaries pick up the OS font.gpui-pre-webresolves that alias to "IBM Plex Sans" and starts with an empty font database, so the first text layout panicked and the canvas never painted. The bundled Inter no longer matched anything. This is the same failure #2933 fixed for the gallery; that PR left the base examples alone because they still rendered at the time.crates/base/examples/showcase/mod.rs,crates/base/examples/motion/mod.rs: bundle the existing IBM Plex Sans subset fromcrates/story-web/fontsinstead of Inter for the web build, so the alias resolves. Inter was not referenced by either example anymore; the wasm download shrinks by about 40 KB.crates/story-web/scripts/subset-fonts.py: also scancrates/base/examples/motionwhen subsetting, so text added to that example stays covered.How to Test
cd crates/base/examples/wasm && make build, thenbun run devinwebsite/and open/base/motionand/base/primitives/button.RefCell already borrowed. Reproduced on https://gpui-kit.com/base/motion and/examples/base?component=button.rustfmt --check,typosandcargo clippy -p gpui-base-examples --all-targets -- --deny warningsare clean.Checklist
cargo runfor story tests related to the changes.