From 0dce8b75d1485f8db3fb9111a6d8b88865cee1e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 21 Apr 2023 20:35:59 +0200 Subject: [PATCH] Fix `examples` --- examples/rich-text/src/main.rs | 4 ++-- examples/terminal/src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/rich-text/src/main.rs b/examples/rich-text/src/main.rs index f569884..b5d1ab4 100644 --- a/examples/rich-text/src/main.rs +++ b/examples/rich-text/src/main.rs @@ -2,7 +2,7 @@ use cosmic_text::{ Action, Attrs, AttrsList, Buffer, BufferLine, Color, Edit, Editor, Family, FontSystem, Metrics, - Style, SwashCache, Weight, + Shaping, Style, SwashCache, Weight, }; use orbclient::{EventOption, Renderer, Window, WindowFlag}; use std::{ @@ -143,7 +143,7 @@ fn main() { editor .buffer_mut() .lines - .push(BufferLine::new(line_text, attrs_list)); + .push(BufferLine::new(line_text, attrs_list, Shaping::Advanced)); } let mut swash_cache = SwashCache::new(); diff --git a/examples/terminal/src/main.rs b/examples/terminal/src/main.rs index 852207f..d5fbeda 100644 --- a/examples/terminal/src/main.rs +++ b/examples/terminal/src/main.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -use cosmic_text::{Attrs, Buffer, Color, FontSystem, Metrics, SwashCache}; +use cosmic_text::{Attrs, Buffer, Color, FontSystem, Metrics, Shaping, SwashCache}; use std::cmp::{self, Ordering}; use termion::{color, cursor}; @@ -28,7 +28,7 @@ fn main() { let attrs = Attrs::new(); // Add some text! - buffer.set_text(" Hi, Rust! 🦀", attrs); + buffer.set_text(" Hi, Rust! 🦀", attrs, Shaping::Advanced); // Perform shaping as desired buffer.shape_until_scroll();