8000 [WIP] Render text with Parley by valadaptive · Pull Request #5784 · emilk/egui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[WIP] Render text with Parley #5784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3c128ce
Revert "Optimize editing long text by caching each paragraph (#5411)"
valadaptive Apr 2, 2025
aacaddc
WIP: Cosmic Text - rendering only
valadaptive Mar 3, 2025
9c294f3
Remove old text_layout module
valadaptive Mar 3, 2025
2a88e75
WIP remove more stuff
valadaptive Mar 3, 2025
cfa70e8
add to todo
valadaptive Mar 4, 2025
870c634
Use Parley instead
valadaptive Mar 4, 2025
c15d469
Implement first_row_min_height
valadaptive Mar 4, 2025
5f40a7f
Fix wrapping layouts
valadaptive Mar 6, 2025
2aa6b90
Supporting changes for text editing 1
valadaptive Mar 12, 2025
b3cfaba
Update todo list
valadaptive Mar 12, 2025
a0ee344
Text selection + editing (mostly)
valadaptive Mar 19, 2025
68d4118
Color emoji
valadaptive Mar 19, 2025
a0b69c0
Update for Parley blob changes
valadaptive Mar 20, 2025
b6ed6a9
Update for Parley register_fonts changes
valadaptive Mar 20, 2025
f327cb2
Stop wrapping FontsImpl in an Arc<Mutex<_>>
valadaptive Mar 20, 2025
b9a5173
Unwrap the FontsAndCache struct
valadaptive Mar 20, 2025
6684ef2
Split borrows in FontImpl better
valadaptive Mar 20, 2025
d4e6122
Make ctx.fonts() return a view type
valadaptive Mar 20, 2025
a71d620
Fix accesskit feature gate
valadaptive Mar 20, 2025
7b32296
Remove pixels_per_point from FontStore
valadaptive Mar 20, 2025
e9c6d35
First part of font loading/fallback support
valadaptive Mar 23, 2025
13e7437
Add with_system_fonts option to FontDefinitions
valadaptive Mar 23, 2025
5b18e65
Implement break_anywhere
valadaptive Mar 25, 2025
1afc2ca
Remove etagere for now
valadaptive Mar 25, 2025
135cc01
Update TODO
valadaptive Mar 25, 2025
79dba5e
Fix break_anywhere for latest Parley
valadaptive Mar 25, 2025
7efd521
Implement text background
valadaptive Mar 26, 2025
e89b484
Implement (visual-only for now) valign
valadaptive Mar 26, 2025
09ee408
Implement overflow character
valadaptive Mar 27, 2025
35e06db
Clean up glyph atlas caching a bit
valadaptive Mar 27, 2025
ae08bca
Un-arc-mutex the texture atlas
valadaptive Mar 27, 2025
e22bbfc
Appease the clip
valadaptive Mar 27, 2025
eed696a
Add font hinting API
valadaptive Mar 27, 2025
465595d
Implement LayoutJob::round_output_to_gui
valadaptive Mar 27, 2025
a550629
Render glyphs into scratch image
valadaptive Mar 29, 2025
4b70f68
Fix RTL justification; clear TODOs
valadaptive Mar 29, 2025
35dd447
Round text decorations to pixel Y
valadaptive Mar 29, 2025
d7912c1
Add to TODO
valadaptive Apr 2, 2025
77b742e
More granular font insertion control
valadaptive Apr 3, 2025
122c420
Update parley todo
valadaptive Apr 24, 2025
8cc9cf9
fixes for latest Parley
valadaptive May 9, 2025
3a4fdec
De-mutex `parley::Layout`
valadaptive May 14, 2025
7c87453
Fix misalignment introduced by quantization
valadaptive May 20, 2025
7d3fd07
Fix test
valadaptive May 20, 2025
8c0e018
Metrics-relative line height
valadaptive May 20, 2025
204fabc
Update todo list
valadaptive May 24, 2025
9b88bea
Comment out broken first_row_min_height code
valadaptive May 26, 2025
3d2d762
Use parley from git
valadaptive Jun 3, 2025
4d28ec8
Add another todo list
valadaptive Jun 7, 2025
6496be5
Lint fixes
valadaptive Jun 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 213 additions & 74 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ puffin_http = "0.16"
raw-window-handle = "0.6.0"
ron = "0.10.1"
serde = { version = "1", features = ["derive"] }
similar-asserts = "1.4.2"
thiserror = "1.0.37"
type-map = "0.5.0"
unicode-segmentation = "1.12.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ Light Theme:
## Dependencies
`egui` has a minimal set of default dependencies:

* [`ab_glyph`](https://crates.io/crates/ab_glyph)
* [`ahash`](https://crates.io/crates/ahash)
* [`bitflags`](https://crates.io/crates/bitflags)
* [`nohash-hasher`](https://crates.io/crates/nohash-hasher)
* [`parking_lot`](https://crates.io/crates/parking_lot)
* [`parley`](https://crates.io/crates/parley)

Heavier dependencies are kept out of `egui`, even as opt-in.
All code in `egui` is Wasm-friendly (even outside a browser).
Expand Down
9 changes: 0 additions & 9 deletions crates/egui-wgpu/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,6 @@ impl Renderer {
);
Cow::Borrowed(&image.pixels)
}
epaint::ImageData::Font(image) => {
assert_eq!(
width as usize * height as usize,
image.pixels.len(),
"Mismatch between texture size and texel count"
);
profiling::scope!("font -> sRGBA");
Cow::Owned(image.srgba_pixels(None).collect::<Vec<epaint::Color32>>())
}
};
let data_bytes: &[u8] = bytemuck::cast_slice(data_color32.as_slice());

Expand Down
2 changes: 1 addition & 1 deletion crates/egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ default = ["default_fonts"]

## Exposes detailed accessibility implementation required by platform
## accessibility APIs. Also requires support in the egui integration.
accesskit = ["dep:accesskit"]
accesskit = ["dep:accesskit", "epaint/accesskit"]

## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`epaint::Vertex`], [`emath::Vec2`] etc to `&[u8]`.
bytemuck = ["epaint/bytemuck"]
Expand Down
Loading
Loading
0