diff --git a/src/shape.rs b/src/shape.rs index 0dbffdd..839630a 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -667,8 +667,14 @@ impl ShapeWord { let is_simple_ascii = word.is_ascii() && !word.chars().any(|c| c.is_ascii_control() && c != '\t'); - if is_simple_ascii && !word.is_empty() { - let _attrs = attrs_list.defaults(); + if is_simple_ascii && !word.is_empty() && { + let attrs_start = attrs_list.get_span(word_range.start); + attrs_list.spans_iter().all(|(other_range, other_attrs)| { + word_range.end <= other_range.start + || other_range.end <= word_range.start + || attrs_start.compatible(&other_attrs.as_attrs()) + }) + } { shaping.run( &mut glyphs, font_system,