Adjust layout_str to use byte coordinates

* Interpret ranges as byte ranges for incoming runs
* Return glyphs whose indices are byte offsets
This commit is contained in:
Max Brunsfeld
2021-05-20 12:47:08 +02:00
committed by Antonio Scandurra
parent a2c36fcdb7
commit 92b938f4a8
3 changed files with 60 additions and 50 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ impl Element for Label {
.font_cache
.select_font(self.family_id, &self.font_properties)
.unwrap();
let text_len = self.text.chars().count();
let text_len = self.text.len();
let mut styles;
let mut colors;
if let Some(highlights) = self.highlights.as_ref() {