Make BorrowedWithFontSystem borrow FontSystem mutably
This commit is contained in:
parent
057b5b6fa9
commit
46e9ef0246
11 changed files with 37 additions and 31 deletions
|
|
@ -335,7 +335,7 @@ impl Buffer {
|
|||
|
||||
pub fn borrow_with<'a>(
|
||||
&'a mut self,
|
||||
font_system: &'a FontSystem,
|
||||
font_system: &'a mut FontSystem,
|
||||
) -> BorrowedWithFontSystem<'a, Buffer> {
|
||||
BorrowedWithFontSystem {
|
||||
inner: self,
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ pub enum Action {
|
|||
pub trait Edit {
|
||||
fn borrow_with<'a>(
|
||||
&'a mut self,
|
||||
font_system: &'a FontSystem,
|
||||
font_system: &'a mut FontSystem,
|
||||
) -> BorrowedWithFontSystem<'a, Self>
|
||||
where
|
||||
Self: Sized,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ pub use fontdb;
|
|||
|
||||
pub struct BorrowedWithFontSystem<'a, T> {
|
||||
pub(crate) inner: &'a mut T,
|
||||
pub(crate) font_system: &'a FontSystem,
|
||||
pub(crate) font_system: &'a mut FontSystem,
|
||||
}
|
||||
|
||||
impl<'a, T> Deref for BorrowedWithFontSystem<'a, T> {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ fn shape_fallback(
|
|||
let rtl = matches!(buffer.direction(), rustybuzz::Direction::RightToLeft);
|
||||
assert_eq!(rtl, span_rtl);
|
||||
|
||||
let glyph_buffer = rustybuzz::shape(&font.rustybuzz(), &[], buffer);
|
||||
let glyph_buffer = rustybuzz::shape(font.rustybuzz(), &[], buffer);
|
||||
let glyph_infos = glyph_buffer.glyph_infos();
|
||||
let glyph_positions = glyph_buffer.glyph_positions();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue