iris: move text state into shared resources
This commit is contained in:
1 parent
4cbe7baea0
commit
a8093b002b
26 files changed
+686
-467
No files matched your search
+3
-3
@@ -279,9 +279,9 @@ rasteriser (`TextData::place`, which reads back whatever `shape` set) is
|
||||
the display's *physical* size, and the glyph atlas holds a bitmap at the
|
||||
resolution it is actually shown at. `GlyphKey.size` already keys on the
|
||||
resolved size, so a cache entry is naturally per-physical-size with no
|
||||
further change. The one caller with no `Painter` to read density from
|
||||
(`TextEditCtx::layout`, cursor movement and hit-testing) reads a second
|
||||
copy kept directly on `TextData` (`TextData::density`) instead — an
|
||||
further change. The callers with no `Painter` to read density from (cursor
|
||||
movement and hit-testing through `TextHandle::layout`) read a second copy kept
|
||||
directly on `TextData` (`TextData::density`) instead — an
|
||||
accepted duplication rather than threading a `Painter` into every input
|
||||
handler for one field, the same tradeoff `AndroidRenderer::content_scale`
|
||||
already makes for the Diagnostics page.
|
||||
|
||||
+12
-7
@@ -814,13 +814,18 @@ private implementations of that wake; applications do not define platform
|
||||
event types or manually request redraws.
|
||||
|
||||
**Iris ships no fonts, and font families are application-named strings**
|
||||
(2026-09-12). Applications register their own font bytes on `Ui` before the
|
||||
first text shape and select them by the same string used by text widgets. The
|
||||
public boundaries accept `AsRef<str>`, so an application can use bare strings
|
||||
or put its own semantic enum in front of them without Iris hardcoding the
|
||||
roles. ai-app owns the `ai-app-icons` family, its Nerd Fonts subset, its
|
||||
codepoints, its license and the script that rebuilds it; the CSS generic names
|
||||
`sans-serif` and `monospace` continue to resolve through the platform.
|
||||
(2026-09-12). Applications register their own font bytes on `Ui` and select
|
||||
them by the same string used by text widgets. The public boundaries accept
|
||||
`AsRef<str>`, so an application can use bare strings or put its own semantic
|
||||
enum in front of them without Iris hardcoding the roles. Text buffers, layouts,
|
||||
and prepared glyphs live in a per-`Ui` generational arena; a text widget holds
|
||||
one compact handle into it, while the arena and its shaping state are shared by
|
||||
one `Rc<RefCell<_>>`. Registering another family invalidates the live arena
|
||||
entries and dirties their active owner widgets, so registration is also valid
|
||||
after the first shape. ai-app owns the `ai-app-icons` family, its Nerd Fonts
|
||||
subset, its codepoints, its license and the script that rebuilds it; the CSS
|
||||
generic names `sans-serif` and `monospace` continue to resolve through the
|
||||
platform.
|
||||
|
||||
`cargo-iris` is an installable Cargo subcommand, rather than a script callers
|
||||
must find inside an Iris checkout. `cargo iris apk` builds the Rust `cdylib`
|
||||
|
||||
Reference in new issue
Block a user