More implementation of new buffer abstraction

This commit is contained in:
Jeremy Soller 2022-10-20 19:34:56 -06:00
parent 2bbacf5636
commit 441112b5e2
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
7 changed files with 244 additions and 397 deletions

View file

@ -1,4 +1,3 @@
use crate::TextLineIndex;
use super::{CacheKey, Font};
pub struct FontLayoutGlyph<'a> {
@ -11,7 +10,6 @@ pub struct FontLayoutGlyph<'a> {
}
pub struct FontLayoutLine<'a> {
pub line_i: TextLineIndex,
pub rtl: bool,
pub glyphs: Vec<FontLayoutGlyph<'a>>,
}

View file

@ -1,6 +1,5 @@
use unicode_script::{Script, UnicodeScript};
use crate::TextLineIndex;
use super::{Font, FontShapeGlyph, FontShapeLine, FontShapeSpan, FontShapeWord};
use super::fallback::{FontFallbackIter};
@ -292,7 +291,7 @@ impl<'a> FontMatches<'a> {
}
}
pub fn shape_line(&self, line_i: TextLineIndex, line: &str) -> FontShapeLine {
pub fn shape_line(&self, line: &str) -> FontShapeLine {
let mut spans = Vec::new();
let bidi = unicode_bidi::BidiInfo::new(line, None);
@ -322,6 +321,6 @@ impl<'a> FontMatches<'a> {
line_rtl
};
FontShapeLine { line_i, rtl, spans }
FontShapeLine { rtl, spans }
}
}

View file

@ -1,4 +1,3 @@
use crate::TextLineIndex;
use super::{CacheKey, Font, FontLayoutGlyph, FontLayoutLine};
pub struct FontShapeGlyph<'a> {
@ -41,7 +40,6 @@ pub struct FontShapeSpan<'a> {
}
pub struct FontShapeLine<'a> {
pub line_i: TextLineIndex,
pub rtl: bool,
pub spans: Vec<FontShapeSpan<'a>>,
}
@ -165,7 +163,6 @@ impl<'a> FontShapeLine<'a> {
layout_lines.insert(
layout_i,
FontLayoutLine {
line_i: self.line_i,
rtl: self.rtl,
glyphs: glyphs_swap,
},
@ -200,7 +197,6 @@ impl<'a> FontShapeLine<'a> {
layout_lines.insert(
layout_i,
FontLayoutLine {
line_i: self.line_i,
rtl: self.rtl,
glyphs: glyphs_swap,
},
@ -217,7 +213,6 @@ impl<'a> FontShapeLine<'a> {
layout_lines.insert(
layout_i,
FontLayoutLine {
line_i: self.line_i,
rtl: self.rtl,
glyphs,
},