pub struct BorrowedWithFontSystem<'a, T> { /* private fields */ }Expand description
A value borrowed together with an FontSystem
Implementations§
Source§impl BorrowedWithFontSystem<'_, Buffer>
impl BorrowedWithFontSystem<'_, Buffer>
Sourcepub fn shape_until_cursor(&mut self, cursor: Cursor, prune: bool)
pub fn shape_until_cursor(&mut self, cursor: Cursor, prune: bool)
Shape lines until cursor, also scrolling to include cursor in view
Sourcepub fn line_shape(&mut self, line_i: usize) -> Option<&ShapeLine>
pub fn line_shape(&mut self, line_i: usize) -> Option<&ShapeLine>
Shape the provided line index and return the result
Sourcepub fn line_layout(&mut self, line_i: usize) -> Option<&[LayoutLine]>
pub fn line_layout(&mut self, line_i: usize) -> Option<&[LayoutLine]>
Lay out the provided line index and return the result
Sourcepub fn set_metrics(&mut self, metrics: Metrics)
pub fn set_metrics(&mut self, metrics: Metrics)
Sourcepub fn set_hinting(&mut self, hinting: Hinting)
pub fn set_hinting(&mut self, hinting: Hinting)
Set the current Hinting strategy.
Sourcepub fn set_ellipsize(&mut self, ellipsize: Ellipsize)
pub fn set_ellipsize(&mut self, ellipsize: Ellipsize)
Set the current Ellipsize.
Sourcepub fn set_size(&mut self, width_opt: Option<f32>, height_opt: Option<f32>)
pub fn set_size(&mut self, width_opt: Option<f32>, height_opt: Option<f32>)
Set the current buffer dimensions.
Sourcepub fn set_metrics_and_size(
&mut self,
metrics: Metrics,
width_opt: Option<f32>,
height_opt: Option<f32>,
)
pub fn set_metrics_and_size( &mut self, metrics: Metrics, width_opt: Option<f32>, height_opt: Option<f32>, )
Sourcepub fn set_tab_width(&mut self, tab_width: u16)
pub fn set_tab_width(&mut self, tab_width: u16)
Set tab width (number of spaces between tab stops).
A tab_width of 0 is ignored.
Sourcepub fn set_monospace_width(&mut self, monospace_width: Option<f32>)
pub fn set_monospace_width(&mut self, monospace_width: Option<f32>)
Set monospace width monospace glyphs should be resized to match. None means don’t resize.
Sourcepub fn set_text(
&mut self,
text: &str,
attrs: &Attrs<'_>,
shaping: Shaping,
alignment: Option<Align>,
)
pub fn set_text( &mut self, text: &str, attrs: &Attrs<'_>, shaping: Shaping, alignment: Option<Align>, )
Set text of buffer, using provided attributes for each line by default.
Sourcepub fn set_rich_text<'r, 's, I>(
&mut self,
spans: I,
default_attrs: &Attrs<'_>,
shaping: Shaping,
alignment: Option<Align>,
)
pub fn set_rich_text<'r, 's, I>( &mut self, spans: I, default_attrs: &Attrs<'_>, shaping: Shaping, alignment: Option<Align>, )
Set text of buffer, using an iterator of styled spans (pairs of text and attributes).
Sourcepub fn shape_until_scroll(&mut self, prune: bool)
pub fn shape_until_scroll(&mut self, prune: bool)
Shape lines until scroll, resolving any pending dirty state first.
Sourcepub fn layout_runs(&mut self) -> LayoutRunIter<'_> ⓘ
pub fn layout_runs(&mut self) -> LayoutRunIter<'_> ⓘ
Get the visible layout runs for rendering and other tasks.
Automatically resolves any pending dirty state.
Sourcepub fn hit(&mut self, x: f32, y: f32) -> Option<Cursor>
pub fn hit(&mut self, x: f32, y: f32) -> Option<Cursor>
Convert x, y position to Cursor (hit detection).
Automatically resolves any pending dirty state.
Source§impl BorrowedWithFontSystem<'_, Editor<'_>>
impl BorrowedWithFontSystem<'_, Editor<'_>>
Source§impl<'buffer, E: Edit<'buffer>> BorrowedWithFontSystem<'_, E>
impl<'buffer, E: Edit<'buffer>> BorrowedWithFontSystem<'_, E>
Sourcepub fn with_buffer_mut<F: FnOnce(&mut BorrowedWithFontSystem<'_, Buffer>) -> T, T>(
&mut self,
f: F,
) -> T
pub fn with_buffer_mut<F: FnOnce(&mut BorrowedWithFontSystem<'_, Buffer>) -> T, T>( &mut self, f: F, ) -> T
Get the internal Buffer, mutably
Sourcepub fn set_tab_width(&mut self, tab_width: u16)
pub fn set_tab_width(&mut self, tab_width: u16)
Set the current tab width. A tab_width of 0 is not allowed, and will be ignored
Sourcepub fn shape_as_needed(&mut self, prune: bool)
pub fn shape_as_needed(&mut self, prune: bool)
Shape lines until scroll, after adjusting scroll if the cursor moved