pub struct TextLayoutOptions {
pub font_size_px: PixelValue,
pub line_height: Option<f32>,
pub letter_spacing: Option<PixelValue>,
pub word_spacing: Option<PixelValue>,
pub tab_width: Option<f32>,
pub max_horizontal_width: Option<f32>,
pub leading: Option<f32>,
pub holes: Vec<LayoutRect>,
}
Expand description
Layout options that can impact the flow of word positions
Fields§
§font_size_px: PixelValue
Font size (in pixels) that this text has been laid out with
line_height: Option<f32>
Multiplier for the line height, default to 1.0
letter_spacing: Option<PixelValue>
Additional spacing between glyphs (in pixels)
word_spacing: Option<PixelValue>
Additional spacing between words (in pixels)
tab_width: Option<f32>
How many spaces should a tab character emulate
(multiplying value, i.e. 4.0
= one tab = 4 spaces)?
max_horizontal_width: Option<f32>
Maximum width of the text (in pixels) - if the text is set to overflow:visible
, set this to None.
leading: Option<f32>
How many pixels of leading does the first line have? Note that this added onto to the holes,
so for effects like :first-letter
, use a hole instead of a leading.
holes: Vec<LayoutRect>
This is more important for inline text layout where items can punch “holes” into the text flow, for example an image that floats to the right.
TODO: Currently unused!
Trait Implementations§
Source§impl Clone for TextLayoutOptions
impl Clone for TextLayoutOptions
Source§fn clone(&self) -> TextLayoutOptions
fn clone(&self) -> TextLayoutOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TextLayoutOptions
impl Debug for TextLayoutOptions
Source§impl Default for TextLayoutOptions
impl Default for TextLayoutOptions
Source§fn default() -> TextLayoutOptions
fn default() -> TextLayoutOptions
Source§impl PartialEq for TextLayoutOptions
impl PartialEq for TextLayoutOptions
Source§impl PartialOrd for TextLayoutOptions
impl PartialOrd for TextLayoutOptions
impl StructuralPartialEq for TextLayoutOptions
Auto Trait Implementations§
impl Freeze for TextLayoutOptions
impl RefUnwindSafe for TextLayoutOptions
impl Send for TextLayoutOptions
impl Sync for TextLayoutOptions
impl Unpin for TextLayoutOptions
impl UnwindSafe for TextLayoutOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)