slint/examples/gallery
Tasuku Suzuki 224a06af57
Gallery Example: Add i18n and dynamic font loading for WASM (#9762)
- Bundle translations for WASM/Android only (not for native builds)
- Load Noto Sans CJK fonts dynamically from GitHub at runtime
- Implement register_font_from_memory() with Result<FontHandle, RegisterFontError>
- Make API automatically available with std feature (no explicit feature flag needed)
- Export load_font_from_bytes() for WASM font loading from JavaScript
- Change from wasm_bindgen(start) to explicit main() call for better control

Fonts are loaded before app initialization to ensure proper CJK text
rendering across all major browsers without bundling font files.

Native builds load translations from lang/ directory at runtime.
WASM/Android builds bundle translations at compile time and detect
browser/system language automatically.

API is now available when std feature is enabled, since we always
have fontique with std. No need for experimental-register-font feature.
2025-11-17 14:00:39 +01:00
..
lang Gallery: Add Japanese translation 2025-05-15 22:09:14 +02:00
ui Add lineedit with password support in gallery 2025-08-01 16:12:54 +02:00
build.rs Gallery Example: Add i18n and dynamic font loading for WASM (#9762) 2025-11-17 14:00:39 +01:00
Cargo.toml Gallery Example: Add i18n and dynamic font loading for WASM (#9762) 2025-11-17 14:00:39 +01:00
CMakeLists.txt Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
gallery.pot Update Translations: extract strings 2024-11-18 03:16:35 +00:00
gallery.slint support for menus with checkmarks (#9056) 2025-08-21 09:07:01 +02:00
index.html Gallery Example: Add i18n and dynamic font loading for WASM (#9762) 2025-11-17 14:00:39 +01:00
main.cpp gallery: added filter example (#6847) 2024-11-22 11:56:54 +01:00
main.rs Gallery Example: Add i18n and dynamic font loading for WASM (#9762) 2025-11-17 14:00:39 +01:00
README.md Janitor: Remove trailing whitespaces from all files 2025-01-10 13:23:22 +01:00
thumbsup.png Replace image in gallery examples 2022-01-19 11:25:21 +01:00
thumbsup.png.license Update license information 2022-01-20 14:45:02 +01:00
update_translations.sh Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00

A simple application showing the different widgets.

Online simulation Preview in Online Code Editor

Gallery on Windows Gallery on Linux Gallery on Mac