mirror of https://github.com/wayvr-org/wayvr.git
chore: update cosmic-text
This commit is contained in:
parent
a10b20aea9
commit
1820e2b152
|
|
@ -532,7 +532,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"rustc-hash 2.1.3",
|
||||
"rustc-hash",
|
||||
"shlex 1.3.0",
|
||||
"syn 2.0.118",
|
||||
]
|
||||
|
|
@ -695,7 +695,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"rustc-hash 2.1.3",
|
||||
"rustc-hash",
|
||||
"shlex 1.3.0",
|
||||
"syn 2.0.118",
|
||||
]
|
||||
|
|
@ -1203,9 +1203,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cosmic-text"
|
||||
version = "0.15.0"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "173852283a9a57a3cbe365d86e74dc428a09c50421477d5ad6fe9d9509e37737"
|
||||
checksum = "be17b688510d934ce13f48a2beba700e11583e281e0fda99c22bb256a14eda73"
|
||||
dependencies = [
|
||||
"bitflags 2.13.0",
|
||||
"fontdb",
|
||||
|
|
@ -1213,10 +1213,10 @@ dependencies = [
|
|||
"linebender_resource_handle",
|
||||
"log",
|
||||
"rangemap",
|
||||
"rustc-hash 1.1.0",
|
||||
"rustc-hash",
|
||||
"self_cell",
|
||||
"skrifa 0.37.0",
|
||||
"smol_str",
|
||||
"skrifa 0.40.0",
|
||||
"smol_str 0.3.6",
|
||||
"swash",
|
||||
"sys-locale",
|
||||
"unicode-bidi",
|
||||
|
|
@ -1948,15 +1948,6 @@ 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 = "font-types"
|
||||
version = "0.11.3"
|
||||
|
|
@ -2284,14 +2275,14 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "harfrust"
|
||||
version = "0.3.2"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92c020db12c71d8a12a3fe7607873cade3a01a6287e29d540c8723276221b9d8"
|
||||
checksum = "9da2e5ae821f6e96664977bf974d6d6a2d6682f9ccee23e62ec1d134246845f9"
|
||||
dependencies = [
|
||||
"bitflags 2.13.0",
|
||||
"bytemuck",
|
||||
"core_maths",
|
||||
"read-fonts 0.35.0",
|
||||
"read-fonts 0.37.0",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
|
|
@ -4705,13 +4696,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "read-fonts"
|
||||
version = "0.35.0"
|
||||
version = "0.37.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6717cf23b488adf64b9d711329542ba34de147df262370221940dfabc2c91358"
|
||||
checksum = "7b634fabf032fab15307ffd272149b622260f55974d9fad689292a5d33df02e5"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"core_maths",
|
||||
"font-types 0.10.1",
|
||||
"font-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4721,7 +4712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "c4ed38b89c2c77ff968c524145ad65fb010f38af5c7a224b53b81d47ac2daa81"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"font-types 0.11.3",
|
||||
"font-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4929,12 +4920,6 @@ version = "0.1.27"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "2.1.3"
|
||||
|
|
@ -5316,12 +5301,12 @@ checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"
|
|||
|
||||
[[package]]
|
||||
name = "skrifa"
|
||||
version = "0.37.0"
|
||||
version = "0.40.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c31071dedf532758ecf3fed987cdb4bd9509f900e026ab684b4ecb81ea49841"
|
||||
checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"read-fonts 0.35.0",
|
||||
"read-fonts 0.37.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5508,6 +5493,12 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "smol_str"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4aaa7368fcf4852a4c2dd92df0cace6a71f2091ca0a23391ce7f3a31833f1523"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.6.4"
|
||||
|
|
@ -6707,7 +6698,7 @@ dependencies = [
|
|||
"resvg",
|
||||
"roxmltree 0.21.1",
|
||||
"rust-embed",
|
||||
"rustc-hash 2.1.3",
|
||||
"rustc-hash",
|
||||
"serde_json",
|
||||
"slotmap",
|
||||
"smallvec",
|
||||
|
|
@ -7167,7 +7158,7 @@ dependencies = [
|
|||
"rustix 0.38.44",
|
||||
"sctk-adwaita",
|
||||
"smithay-client-toolkit 0.19.2",
|
||||
"smol_str",
|
||||
"smol_str 0.2.2",
|
||||
"tracing",
|
||||
"unicode-segmentation",
|
||||
"wasm-bindgen",
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ smallvec.workspace = true
|
|||
vulkano.workspace = true
|
||||
vulkano-shaders.workspace = true
|
||||
|
||||
cosmic-text = "0.15.0"
|
||||
cosmic-text = "0.19.0"
|
||||
etagere = "0.2.15"
|
||||
flate2 = "1.1.5"
|
||||
image = {
|
||||
|
|
|
|||
|
|
@ -77,11 +77,9 @@ impl WidgetLabel {
|
|||
|
||||
self.params.content = translation;
|
||||
let attrs = Attrs::from(&self.params.style);
|
||||
let mut font_system = globals.font_system.system.lock();
|
||||
|
||||
let mut buffer = self.buffer.borrow_mut();
|
||||
buffer.set_rich_text(
|
||||
&mut font_system,
|
||||
[(self.params.content.generate(&mut globals.i18n_builtin).as_ref(), attrs)],
|
||||
&Attrs::new(),
|
||||
Shaping::Advanced,
|
||||
|
|
@ -120,9 +118,8 @@ impl WidgetObj for WidgetLabel {
|
|||
fn draw(&mut self, state: &mut super::DrawState, _params: &super::DrawParams) {
|
||||
let boundary = drawing::Boundary::construct_relative(state.transform_stack);
|
||||
|
||||
let mut font_system = state.globals.font_system.system.lock();
|
||||
let mut buffer = self.buffer.borrow_mut();
|
||||
buffer.set_size(&mut font_system, Some(boundary.size.x), Some(boundary.size.y));
|
||||
buffer.set_size(Some(boundary.size.x), Some(boundary.size.y));
|
||||
|
||||
state.primitives.push(drawing::RenderPrimitive::Text(
|
||||
PrimitiveExtent {
|
||||
|
|
@ -136,7 +133,7 @@ impl WidgetObj for WidgetLabel {
|
|||
|
||||
fn measure(
|
||||
&mut self,
|
||||
globals: &Globals,
|
||||
_globals: &Globals,
|
||||
known_dimensions: taffy::Size<Option<f32>>,
|
||||
available_space: taffy::Size<taffy::AvailableSpace>,
|
||||
) -> taffy::Size<f32> {
|
||||
|
|
@ -147,11 +144,8 @@ impl WidgetObj for WidgetLabel {
|
|||
AvailableSpace::Definite(width) => Some(width),
|
||||
});
|
||||
|
||||
let wgui_font_system = &globals.font_system;
|
||||
let mut font_system = wgui_font_system.system.lock();
|
||||
let mut buffer = self.buffer.borrow_mut();
|
||||
|
||||
buffer.set_size(&mut font_system, width_constraint, None);
|
||||
buffer.set_size(width_constraint, None);
|
||||
|
||||
// Determine measured size of text
|
||||
let (width, total_lines) = buffer.layout_runs().fold((0.0, 0usize), |(width, total_lines), run| {
|
||||
|
|
|
|||
Loading…
Reference in New Issue