pub struct TextConfig {Show 14 fields
pub position_size_config: Option<PositionSizeConfig>,
pub clip_rect: Option<Option<PositionSizeConfig>>,
pub hidden: Option<bool>,
pub ignore_render_layer: Option<bool>,
pub content: Option<String>,
pub font_size: Option<f32>,
pub color: Option<[u8; 4]>,
pub background_color: Option<[u8; 4]>,
pub background_rounding: Option<f32>,
pub font: Option<String>,
pub selectable: Option<bool>,
pub hyperlink_text: Option<Vec<(String, HyperlinkSelectMethod)>>,
pub truncate: Option<bool>,
pub tags: Option<Vec<[String; 2]>>,
}Expand description
文本的可配置项。
Fields§
§position_size_config: Option<PositionSizeConfig>位置尺寸配置。
clip_rect: Option<Option<PositionSizeConfig>>允许渲染的范围。
隐藏。
ignore_render_layer: Option<bool>忽略渲染层。
content: Option<String>文本内容。
font_size: Option<f32>字号。
color: Option<[u8; 4]>文本颜色。
background_color: Option<[u8; 4]>背景颜色。
background_rounding: Option<f32>圆角。
font: Option<String>字体。
selectable: Option<bool>是否可框选。
hyperlink_text: Option<Vec<(String, HyperlinkSelectMethod)>>超链接文本。
truncate: Option<bool>是否使用截断文本功能。
标签。
Implementations§
Source§impl TextConfig
impl TextConfig
pub fn from_text(text: &Text) -> Self
pub fn position_size_config( self, position_size_config: Option<PositionSizeConfig>, ) -> Self
pub fn clip_rect(self, clip_rect: Option<Option<PositionSizeConfig>>) -> Self
pub fn ignore_render_layer(self, ignore_render_layer: Option<bool>) -> Self
pub fn content(self, content: Option<String>) -> Self
pub fn font_size(self, font_size: Option<f32>) -> Self
pub fn color(self, color: Option<[u8; 4]>) -> Self
pub fn background_color(self, background_color: Option<[u8; 4]>) -> Self
pub fn background_rounding(self, background_rounding: Option<f32>) -> Self
pub fn font(self, font: Option<String>) -> Self
pub fn selectable(self, selectable: Option<bool>) -> Self
pub fn hyperlink_text( self, hyperlink_text: Option<Vec<(String, HyperlinkSelectMethod)>>, ) -> Self
pub fn truncate(self, truncate: Option<bool>) -> Self
Trait Implementations§
Source§impl Clone for TextConfig
impl Clone for TextConfig
Source§fn clone(&self) -> TextConfig
fn clone(&self) -> TextConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextConfig
impl Debug for TextConfig
Source§impl Default for TextConfig
impl Default for TextConfig
Source§fn default() -> TextConfig
fn default() -> TextConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for TextConfig
impl PartialEq for TextConfig
Source§impl PartialOrd for TextConfig
impl PartialOrd for TextConfig
impl StructuralPartialEq for TextConfig
Auto Trait Implementations§
impl Freeze for TextConfig
impl RefUnwindSafe for TextConfig
impl Send for TextConfig
impl Sync for TextConfig
impl Unpin for TextConfig
impl UnwindSafe for TextConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().