Remove the `Font` borrow-bag; put its methods on `FontsImpl` (#8504)
`Font<'a>` was a hand-rolled split borrow of every field of `FontsImpl`, and it grew a new `&'a mut` for each new feature. `text_layout` now calls `FontsImpl` directly (`resolve_face`, `glyph_info`, `allocate_glyph`, `rasterize_cluster`, …) with a cheap `FamilyKey` index instead of re-hashing the `FontFamily` per glyph. `font.rs` is renamed to `font_face.rs`, since only `FontFace` is left in it. `FontsView::characters` replaces `f.fonts.font(family).characters()` in the font book demo. `FontsImpl` and `epaint::text::layout` are now crate-private: nothing outside `epaint` used them, and `Fonts` / `FontsView` cover the public API. The `fonts` fields of `Fonts` and `FontsView` are private too. The benchmark that used `layout` directly now calls the new `Fonts::layout_uncached`. * [x] I have followed the instructions in the PR template PR chain, in order: * #8490 * #8500 * #8501 * #8502 * #8503 * #8504 * #8491 * #8492 * #8493 --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
E
Emil Ernerfeldt committed
e39e793d5c86b35e81405ec86110a817154feba3
Parent: 0132e5d
Committed by GitHub <noreply@github.com>
on 9/5/2026, 5:01:45 PM