Struct style::font_face::FontFaceRuleData
source · pub struct FontFaceRuleData {Show 15 fields
pub family: Option<FamilyName>,
pub sources: Option<SourceList>,
pub style: Option<FontStyle>,
pub weight: Option<FontWeightRange>,
pub stretch: Option<FontStretchRange>,
pub display: Option<FontDisplay>,
pub unicode_range: Option<Vec<UnicodeRange>>,
pub feature_settings: Option<FontFeatureSettings>,
pub variation_settings: Option<FontVariationSettings>,
pub language_override: Option<SpecifiedValue>,
pub ascent_override: Option<MetricsOverride>,
pub descent_override: Option<MetricsOverride>,
pub line_gap_override: Option<MetricsOverride>,
pub size_adjust: Option<NonNegativePercentage>,
pub source_location: SourceLocation,
}
Expand description
Data inside a @font-face
rule.
Fields§
§family: Option<FamilyName>
The name of this font face
sources: Option<SourceList>
The alternative sources for this font face.
style: Option<FontStyle>
The style of this font face.
weight: Option<FontWeightRange>
The weight of this font face.
stretch: Option<FontStretchRange>
The stretch of this font face.
display: Option<FontDisplay>
The display of this font face.
unicode_range: Option<Vec<UnicodeRange>>
The ranges of code points outside of which this font face should not be used.
feature_settings: Option<FontFeatureSettings>
The feature settings of this font face.
variation_settings: Option<FontVariationSettings>
The variation settings of this font face.
language_override: Option<SpecifiedValue>
The language override of this font face.
ascent_override: Option<MetricsOverride>
The ascent override for this font face.
descent_override: Option<MetricsOverride>
The descent override for this font face.
line_gap_override: Option<MetricsOverride>
The line-gap override for this font face.
size_adjust: Option<NonNegativePercentage>
The size adjustment for this font face.
source_location: SourceLocation
Line and column of the @font-face rule source code.
Implementations§
source§impl FontFaceRuleData
impl FontFaceRuleData
sourcepub fn empty(location: SourceLocation) -> Self
pub fn empty(location: SourceLocation) -> Self
Create an empty font-face rule
sourcepub fn decl_to_css(&self, dest: &mut CssStringWriter) -> Result
pub fn decl_to_css(&self, dest: &mut CssStringWriter) -> Result
Serialization of declarations in the FontFaceRule
source§impl FontFaceRuleData
impl FontFaceRuleData
sourcepub fn font_face(&self) -> Option<FontFace<'_>>
pub fn font_face(&self) -> Option<FontFace<'_>>
Per https://github.com/w3c/csswg-drafts/issues/1133 an @font-face rule is valid as far as the CSS parser is concerned even if it doesn’t have a font-family or src declaration.
However both are required for the rule to represent an actual font face.
Trait Implementations§
source§impl Clone for FontFaceRuleData
impl Clone for FontFaceRuleData
source§fn clone(&self) -> FontFaceRuleData
fn clone(&self) -> FontFaceRuleData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FontFaceRuleData
impl Debug for FontFaceRuleData
source§impl PartialEq for FontFaceRuleData
impl PartialEq for FontFaceRuleData
source§fn eq(&self, other: &FontFaceRuleData) -> bool
fn eq(&self, other: &FontFaceRuleData) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl ToCssWithGuard for FontFaceRuleData
impl ToCssWithGuard for FontFaceRuleData
source§fn to_css(
&self,
_guard: &SharedRwLockReadGuard<'_>,
dest: &mut CssStringWriter,
) -> Result
fn to_css( &self, _guard: &SharedRwLockReadGuard<'_>, dest: &mut CssStringWriter, ) -> Result
self
in CSS syntax, writing to dest
, using the given lock guard.source§fn to_css_string(&self, guard: &SharedRwLockReadGuard<'_>) -> CssString
fn to_css_string(&self, guard: &SharedRwLockReadGuard<'_>) -> CssString
self
in CSS syntax using the given lock guard and return a string. Read moresource§impl ToShmem for FontFaceRuleData
impl ToShmem for FontFaceRuleData
impl StructuralPartialEq for FontFaceRuleData
Auto Trait Implementations§
impl Freeze for FontFaceRuleData
impl RefUnwindSafe for FontFaceRuleData
impl Send for FontFaceRuleData
impl Sync for FontFaceRuleData
impl Unpin for FontFaceRuleData
impl UnwindSafe for FontFaceRuleData
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> 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>
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>
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 more