#[non_exhaustive]
pub enum AttrType {
Show 38 variants
Invalid,
Language,
Family,
Style,
Weight,
Variant,
Stretch,
Size,
FontDesc,
Foreground,
Background,
Underline,
Strikethrough,
Rise,
Shape,
Scale,
Fallback,
LetterSpacing,
UnderlineColor,
StrikethroughColor,
AbsoluteSize,
Gravity,
GravityHint,
FontFeatures,
ForegroundAlpha,
BackgroundAlpha,
AllowBreaks,
Show,
InsertHyphens,
Overline,
OverlineColor,
LineHeight,
AbsoluteLineHeight,
TextTransform,
Word,
Sentence,
BaselineShift,
FontScale,
// some variants omitted
}
Expand description
The AttrType
distinguishes between different types of attributes.
Along with the predefined values, it is possible to allocate additional
values for custom attributes using register()
. The predefined
values are given below. The type of structure used to store the attribute is
listed in parentheses after the description.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Invalid
does not happen
Language
language (AttrLanguage
)
Family
font family name list (AttrString
)
Style
font slant style (AttrInt
)
Weight
font weight (AttrInt
)
Variant
font variant (normal or small caps) (AttrInt
)
Stretch
font stretch (AttrInt
)
Size
font size in points scaled by PANGO_SCALE
(AttrInt
)
FontDesc
font description (AttrFontDesc
)
Foreground
foreground color (AttrColor
)
Background
background color (AttrColor
)
Underline
whether the text has an underline (AttrInt
)
Strikethrough
whether the text is struck-through (AttrInt
)
Rise
baseline displacement (AttrInt
)
Shape
shape (AttrShape
)
Scale
font size scale factor (AttrFloat
)
Fallback
whether fallback is enabled (AttrInt
)
LetterSpacing
letter spacing (AttrInt
)
UnderlineColor
underline color (AttrColor
)
StrikethroughColor
strikethrough color (AttrColor
)
AbsoluteSize
font size in pixels scaled by PANGO_SCALE
(AttrInt
)
Gravity
base text gravity (AttrInt
)
GravityHint
gravity hint (AttrInt
)
FontFeatures
OpenType font features (AttrFontFeatures
). Since 1.38
ForegroundAlpha
foreground alpha (AttrInt
). Since 1.38
BackgroundAlpha
background alpha (AttrInt
). Since 1.38
AllowBreaks
whether breaks are allowed (AttrInt
). Since 1.44
Show
how to render invisible characters (AttrInt
). Since 1.44
InsertHyphens
whether to insert hyphens at intra-word line breaks (AttrInt
). Since 1.44
Overline
whether the text has an overline (AttrInt
). Since 1.46
OverlineColor
overline color (AttrColor
). Since 1.46
LineHeight
v1_50
only.line height factor (AttrFloat
). Since: 1.50
AbsoluteLineHeight
v1_50
only.line height (AttrInt
). Since: 1.50
TextTransform
v1_50
only.Word
v1_50
only.override segmentation to classify the range of the attribute as a single word (AttrInt
). Since 1.50
Sentence
v1_50
only.override segmentation to classify the range of the attribute as a single sentence (AttrInt
). Since 1.50
BaselineShift
v1_50
only.baseline displacement (AttrInt
). Since 1.50
FontScale
v1_50
only.font-relative size change (AttrInt
). Since 1.50
Implementations§
Trait Implementations§
source§impl<'a> FromValue<'a> for AttrType
impl<'a> FromValue<'a> for AttrType
§type Checker = GenericValueTypeChecker<AttrType>
type Checker = GenericValueTypeChecker<AttrType>
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value
. Read moresource§impl HasParamSpec for AttrType
impl HasParamSpec for AttrType
source§impl Ord for AttrType
impl Ord for AttrType
source§impl PartialEq<AttrType> for AttrType
impl PartialEq<AttrType> for AttrType
source§impl PartialOrd<AttrType> for AttrType
impl PartialOrd<AttrType> for AttrType
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for AttrType
impl StaticType for AttrType
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Copy for AttrType
impl Eq for AttrType
impl StructuralEq for AttrType
impl StructuralPartialEq for AttrType
Auto Trait Implementations§
impl RefUnwindSafe for AttrType
impl Send for AttrType
impl Sync for AttrType
impl Unpin for AttrType
impl UnwindSafe for AttrType
Blanket Implementations§
source§impl<T> IntoClosureReturnValue for Twhere
T: Into<Value>,
impl<T> IntoClosureReturnValue for Twhere T: Into<Value>,
fn into_closure_return_value(self) -> Option<Value>
source§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere T: HasParamSpec,
source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere T: StaticType,
source§fn ensure_type()
fn ensure_type()
source§impl<T> ToSendValue for Twhere
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for Twhere T: Send + ToValue + ?Sized,
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.