-
-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Repro
main.rs:
use swash::FontRef;
use swash::shape::ShapeContext;
fn main() {
let mut shape_context = ShapeContext::new();
let font = std::fs::read("/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc").unwrap();
let font = FontRef::from_index(&font, 0).unwrap();
let mut shaper = shape_context.builder(font).build();
shaper.add_str("\u{3000}");
shaper.shape_with(|glyph_cluster| {
println!(
"glyph_cluster.whitespace: {:?}",
glyph_cluster.info.whitespace()
);
println!(
"glyph_cluster.is_whitespace(): {}",
glyph_cluster.info.is_whitespace()
);
});
println!();
println!(
"'\\u{{3000}}'.is_whitespace(): {}",
'\u{3000}'.is_whitespace()
);
}Cargo.toml:
[package]
name = "swash-space-repro"
version = "0.1.0"
edition = "2024"
[dependencies]
swash = "0.2.5"Output
actual output (cargo run):
glyph_cluster.whitespace: None
glyph_cluster.is_whitespace(): false
'\u{3000}'.is_whitespace(): true
expected output:
glyph_cluster.whitespace: Space
glyph_cluster.is_whitespace(): true
'\u{3000}'.is_whitespace(): true
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels