More implementation of new buffer abstraction
This commit is contained in:
parent
2bbacf5636
commit
441112b5e2
7 changed files with 244 additions and 397 deletions
|
|
@ -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>>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue