From f07e7bab705e69d39a5e6e52c73039a93c4552f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Wed, 8 May 2024 19:25:47 +0200 Subject: [PATCH] Revert "Bump cosmic text to 0.11 (#89)" This reverts commit c16b6eb9575684c78bda0a0abd1fd9bb1fd0fe30. --- Cargo.toml | 2 +- examples/hello-world.rs | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d421ca9..a55efb2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0 OR Zlib" [dependencies] wgpu = { version = "0.19", default-features = false, features = ["wgsl"] } etagere = "0.2.10" -cosmic-text = "0.11" +cosmic-text = "0.10" lru = { version = "0.12.1", default-features = false } rustc-hash = "1.1" diff --git a/examples/hello-world.rs b/examples/hello-world.rs index c400e40..c7f7732 100644 --- a/examples/hello-world.rs +++ b/examples/hello-world.rs @@ -25,11 +25,13 @@ async fn run() { // Set up window let (width, height) = (800, 600); let event_loop = EventLoop::new().unwrap(); - let window = Arc::new(WindowBuilder::new() - .with_inner_size(LogicalSize::new(width as f64, height as f64)) - .with_title("glyphon hello world") - .build(&event_loop) - .unwrap()); + let window = Arc::new( + WindowBuilder::new() + .with_inner_size(LogicalSize::new(width as f64, height as f64)) + .with_title("glyphon hello world") + .build(&event_loop) + .unwrap(), + ); let size = window.inner_size(); let scale_factor = window.scale_factor(); @@ -51,7 +53,9 @@ async fn run() { .await .unwrap(); - let surface = instance.create_surface(window.clone()).expect("Create surface"); + let surface = instance + .create_surface(window.clone()) + .expect("Create surface"); let swapchain_format = TextureFormat::Bgra8UnormSrgb; let mut config = SurfaceConfiguration { usage: TextureUsages::RENDER_ATTACHMENT, @@ -80,7 +84,7 @@ async fn run() { buffer.set_size(&mut font_system, physical_width, physical_height); buffer.set_text(&mut font_system, "Hello world! 👋\nThis is rendered with 🦅 glyphon 🦁\nThe text below should be partially clipped.\na b c d e f g h i j k l m n o p q r s t u v w x y z", Attrs::new().family(Family::SansSerif), Shaping::Advanced); - buffer.shape_until_scroll(&mut font_system, false); + buffer.shape_until_scroll(&mut font_system); event_loop .run(move |event, target| {