mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use byte indices instead of char indices for text runs
Replace character indices with UTF-8 byte offsets throughout the code dealing with text shaping and breaking. This eliminates a lot of complexity when converting from one to the other, and interoperates better with the rest of the Rust ecosystem.
This commit is contained in:
parent
dba878dfb2
commit
659305fe0a
15 changed files with 259 additions and 437 deletions
|
@ -154,7 +154,7 @@ impl Font {
|
|||
|
||||
let start_time = time::precise_time_ns();
|
||||
|
||||
let mut glyphs = GlyphStore::new(text.chars().count(),
|
||||
let mut glyphs = GlyphStore::new(text.len(),
|
||||
options.flags.contains(IS_WHITESPACE_SHAPING_FLAG),
|
||||
options.flags.contains(RTL_FLAG));
|
||||
shaper.as_ref().unwrap().shape_text(text, options, &mut glyphs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue