Added an enum with the option for "No Wraping"
This commit is contained in:
parent
48087b592b
commit
b9fef72f76
7 changed files with 169 additions and 96 deletions
|
|
@ -1,5 +1,7 @@
|
|||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
|
||||
use core::fmt::Display;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
|
|
@ -57,3 +59,24 @@ pub struct LayoutLine {
|
|||
/// Glyphs in line
|
||||
pub glyphs: Vec<LayoutGlyph>,
|
||||
}
|
||||
|
||||
/// Wrapping mode
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
|
||||
pub enum Wrap {
|
||||
/// No wrapping
|
||||
None,
|
||||
/// Wraps at a glyph level
|
||||
Glyph,
|
||||
/// Word Wrapping
|
||||
Word,
|
||||
}
|
||||
|
||||
impl Display for Wrap {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
match self {
|
||||
Self::None => write!(f, "No Wrap"),
|
||||
Self::Word => write!(f, "Word Wrap"),
|
||||
Self::Glyph => write!(f, "Character"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue