WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
128 changes: 123 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,15 @@ dependencies = [
"unicode-width",
]

[[package]]
name = "color"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a18ef4657441fb193b65f34dc39b3781f0dfec23d3bd94d0eeb4e88cde421edb"
dependencies = [
"bytemuck",
]

[[package]]
name = "color-hex"
version = "0.2.0"
Expand Down Expand Up @@ -1595,7 +1604,6 @@ dependencies = [
name = "epaint"
version = "0.33.2"
dependencies = [
"ab_glyph",
"ahash",
"bytemuck",
"criterion",
Expand All @@ -1609,8 +1617,11 @@ dependencies = [
"parking_lot",
"profiling",
"rayon",
"self_cell",
"serde",
"similar-asserts",
"skrifa",
"vello_cpu",
]

[[package]]
Expand Down Expand Up @@ -1639,6 +1650,15 @@ version = "3.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f"

[[package]]
name = "euclid"
version = "0.22.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48"
dependencies = [
"num-traits",
]

[[package]]
name = "event-listener"
version = "5.3.1"
Expand Down Expand Up @@ -1706,6 +1726,15 @@ dependencies = [
"simd-adler32",
]

[[package]]
name = "fearless_simd"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fb2907d1f08b2b316b9223ced5b0e89d87028ba8deae9764741dba8ff7f3903"
dependencies = [
"bytemuck",
]

[[package]]
name = "file_dialog"
version = "0.1.0"
Expand Down Expand Up @@ -1749,6 +1778,15 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"

[[package]]
name = "font-types"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39a654f404bbcbd48ea58c617c2993ee91d1cb63727a37bf2323a4edeed1b8c5"
dependencies = [
"bytemuck",
]

[[package]]
name = "fontconfig-parser"
version = "0.5.7"
Expand Down Expand Up @@ -2528,6 +2566,17 @@ dependencies = [
"smallvec",
]

[[package]]
name = "kurbo"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce9729cc38c18d86123ab736fd2e7151763ba226ac2490ec092d1dd148825e32"
dependencies = [
"arrayvec",
"euclid",
"smallvec",
]

[[package]]
name = "lazy_static"
version = "1.5.0"
Expand Down Expand Up @@ -2577,6 +2626,12 @@ dependencies = [
"redox_syscall 0.5.7",
]

[[package]]
name = "linebender_resource_handle"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"

[[package]]
name = "linked-hash-map"
version = "0.5.6"
Expand Down Expand Up @@ -3253,6 +3308,19 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"

[[package]]
name = "peniko"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3c76095c9a636173600478e0373218c7b955335048c2bcd12dc6a79657649d8"
dependencies = [
"bytemuck",
"color",
"kurbo 0.12.0",
"linebender_resource_handle",
"smallvec",
]

[[package]]
name = "percent-encoding"
version = "2.3.2"
Expand Down Expand Up @@ -3383,9 +3451,9 @@ dependencies = [

[[package]]
name = "png"
version = "0.17.14"
version = "0.17.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0"
checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
dependencies = [
"bitflags 1.3.2",
"crc32fast",
Expand Down Expand Up @@ -3692,6 +3760,16 @@ dependencies = [
"crossbeam-utils",
]

[[package]]
name = "read-fonts"
version = "0.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ad4bbcc6571cb756b6c2572f0e7b387d579a60c3bb30212b91d79141a11ede8"
dependencies = [
"bytemuck",
"font-types",
]

[[package]]
name = "redox_syscall"
version = "0.4.1"
Expand Down Expand Up @@ -3985,6 +4063,12 @@ dependencies = [
"tiny-skia",
]

[[package]]
name = "self_cell"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16c2f82143577edb4921b71ede051dac62ca3c16084e918bf7b40c96ae10eb33"

[[package]]
name = "serde"
version = "1.0.228"
Expand Down Expand Up @@ -4112,6 +4196,16 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"

[[package]]
name = "skrifa"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c31071dedf532758ecf3fed987cdb4bd9509f900e026ab684b4ecb81ea49841"
dependencies = [
"bytemuck",
"read-fonts",
]

[[package]]
name = "slab"
version = "0.4.9"
Expand Down Expand Up @@ -4233,7 +4327,7 @@ version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"
dependencies = [
"kurbo",
"kurbo 0.11.1",
Copy link
Owner

@emilk emilk Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame we get a duplicate kurbo because of resvg, and resvg hasn't had a crate release in over 8 months :/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix that. I am working on a round of releases this month.

"siphasher",
]

Expand Down Expand Up @@ -4735,7 +4829,7 @@ dependencies = [
"flate2",
"fontdb",
"imagesize",
"kurbo",
"kurbo 0.11.1",
"log",
"pico-args",
"roxmltree",
Expand Down Expand Up @@ -4763,6 +4857,30 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"

[[package]]
name = "vello_common"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a235ba928b3109ad9e7696270edb09445a52ae1c7c08e6d31a19b1cdd6cbc24a"
dependencies = [
"bytemuck",
"fearless_simd",
"log",
"peniko",
"skrifa",
"smallvec",
]

[[package]]
name = "vello_cpu"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0bd1fcf9c1814f17a491e07113623d44e3ec1125a9f3401f5e047d6d326da21"
dependencies = [
"bytemuck",
"vello_common",
]

[[package]]
name = "version_check"
version = "0.9.5"
Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ eframe = { version = "0.33.2", path = "crates/eframe", default-features = false
accesskit = "0.21.1"
accesskit_consumer = "0.30.1"
accesskit_winit = "0.29.1"
ab_glyph = "0.2.32"
ahash = { version = "0.8.12", default-features = false, features = [
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
"std",
Expand Down Expand Up @@ -122,8 +121,10 @@ rayon = "1.11.0"
resvg = { version = "0.45.1", default-features = false }
rfd = "0.15.4"
ron = "0.11.0"
self_cell = "1.2.1"
serde = { version = "1.0.228", features = ["derive"] }
similar-asserts = "1.7.0"
skrifa = "0.37"
smallvec = "1.15.1"
smithay-clipboard = "0.7.2"
static_assertions = "1.1.0"
Expand All @@ -135,6 +136,7 @@ toml = "0.8"
type-map = "0.5.1"
unicode_names2 = { version = "2.0.0", default-features = false }
unicode-segmentation = "1.12.0"
vello_cpu = { version = "0.0.4", default-features = false, features = ["std"] }
wasm-bindgen = "0.2.100" # Keep wasm-bindgen version in sync in: setup_web.sh, Cargo.toml, Cargo.lock, rust.yml
wasm-bindgen-futures = "0.4.0"
wayland-cursor = { version = "0.31.11", default-features = false }
Expand Down
33 changes: 14 additions & 19 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
ModifierNames, Modifiers, NumExt as _, Order, Painter, RawInput, Response, RichText,
SafeAreaInsets, ScrollArea, Sense, Style, TextStyle, TextureHandle, TextureOptions, Ui,
ViewportBuilder, ViewportCommand, ViewportId, ViewportIdMap, ViewportIdPair, ViewportIdSet,
ViewportOutput, Widget as _, WidgetRect, WidgetText,
ViewportOutput, Visuals, Widget as _, WidgetRect, WidgetText,
animation_manager::AnimationManager,
containers::{self, area::AreaState},
data::output::PlatformOutput,
Expand All @@ -34,8 +34,7 @@ use crate::{
os::OperatingSystem,
output::FullOutput,
pass_state::PassState,
plugin,
plugin::TypedPluginHandle,
plugin::{self, TypedPluginHandle},
resize, response, scroll_area,
util::IdTypeMap,
viewport::ViewportClass,
Expand Down Expand Up @@ -564,7 +563,10 @@ impl ContextImpl {
log::trace!("Adding new fonts");
}

let text_alpha_from_coverage = self.memory.options.style().visuals.text_alpha_from_coverage;
let Visuals {
mut text_options, ..
} = self.memory.options.style().visuals;
text_options.max_texture_side = max_texture_side;

let mut is_new = false;

Expand All @@ -573,16 +575,12 @@ impl ContextImpl {

is_new = true;
profiling::scope!("Fonts::new");
Fonts::new(
max_texture_side,
text_alpha_from_coverage,
self.font_definitions.clone(),
)
Fonts::new(text_options, self.font_definitions.clone())
});

{
profiling::scope!("Fonts::begin_pass");
fonts.begin_pass(max_texture_side, text_alpha_from_coverage);
fonts.begin_pass(text_options);
}
}

Expand Down Expand Up @@ -2006,15 +2004,12 @@ impl Context {
pub fn set_fonts(&self, font_definitions: FontDefinitions) {
profiling::function_scope!();

let mut update_fonts = true;

self.read(|ctx| {
if let Some(current_fonts) = ctx.fonts.as_ref() {
// NOTE: this comparison is expensive since it checks TTF data for equality
if current_fonts.definitions() == &font_definitions {
update_fonts = false; // no need to update
}
}
let update_fonts = self.read(|ctx| {
// NOTE: this comparison is expensive since it checks TTF data for equality
// TODO(valadaptive): add_font only checks the *names* for equality. Change this?
ctx.fonts
.as_ref()
.is_none_or(|fonts| fonts.definitions() != &font_definitions)
});

if update_fonts {
Expand Down
Loading
Loading