Enum conrod::glyph_cache::LineBreak
[−]
[src]
pub enum LineBreak { Wrap(usize, usize), Newline(usize, usize), }
The two types of LineBreak indices returned by the WrapIndicesBy iterators.
Variants
Wrap(usize, usize)
The first usize
is an index at which the string should wrap due to exceeding a maximum
width.
The second usize
is the byte length which should be skipped in order to reach the first
non-whitespace character to use as the beginning of the next line.
Newline(usize, usize)
An index at which the string breaks due to a newline character, along with the width of the "newline" token in bytes.
Methods
impl LineBreak
[src]
fn index(self) -> usize
Extracts the index at which the break occurs within the text (i.e. the index following the last byte of the line).
fn next_by_character<C>(cache: &GlyphCache<C>, font_size: FontSize, text: &str, max_width: Scalar) -> Option<Self> where C: CharacterCache
Returns the next index at which the text will break by either:
- A newline character.
- A line wrap at the beginning of the first character exceeding the max_width
.
fn next_by_whitespace<C>(cache: &GlyphCache<C>, font_size: FontSize, text: &str, max_width: Scalar) -> Option<Self> where C: CharacterCache
Returns the next index at which the text will break by either:
- A newline character.
- A line wrap at the beginning of the whitespace that preceeds the first word exceeding the
max_width
.
Trait Implementations
impl PartialEq for LineBreak
[src]
fn eq(&self, __arg_0: &LineBreak) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LineBreak) -> bool
This method tests for !=
.
impl Debug for LineBreak
[src]
impl Clone for LineBreak
[src]
fn clone(&self) -> LineBreak
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more