37 lines
1.1 KiB
Rust
37 lines
1.1 KiB
Rust
use crate::core::alignment;
|
|
use crate::core::{Color, Font, Rectangle};
|
|
|
|
/// A paragraph of text.
|
|
#[derive(Debug, Clone, Copy)]
|
|
pub struct Text<'a> {
|
|
/// The content of the [`Text`].
|
|
pub content: &'a str,
|
|
|
|
/// The layout bounds of the [`Text`].
|
|
pub bounds: Rectangle,
|
|
|
|
/// The color of the [`Text`], in __linear RGB_.
|
|
pub color: Color,
|
|
|
|
/// The size of the [`Text`].
|
|
pub size: f32,
|
|
|
|
/// The font of the [`Text`].
|
|
pub font: Font,
|
|
|
|
/// The horizontal alignment of the [`Text`].
|
|
pub horizontal_alignment: alignment::Horizontal,
|
|
|
|
/// The vertical alignment of the [`Text`].
|
|
pub vertical_alignment: alignment::Vertical,
|
|
|
|
/// Whether the text needs advanced shaping and font fallback.
|
|
///
|
|
/// You will need to enable this flag if the text contains a complex
|
|
/// script, the font used needs it, and/or multiple fonts in your system
|
|
/// may be needed to display all of the glyphs.
|
|
///
|
|
/// Advanced shaping is expensive! You should only enable it when
|
|
/// necessary.
|
|
pub advanced_shape: bool,
|
|
}
|