pub struct FontQuery {
pub font_size: f32,
pub font_weight: u16,
pub font_style: FontStyle,
pub font_family: String,
pub letter_spacing: f32,
pub word_spacing: f32,
}Expand description
Query for font lookup — the CSS properties that affect font selection.
Chrome equivalent: FontDescription.
Fields§
§font_size: f32Font size in CSS pixels.
font_weight: u16Font weight (100-900). Chrome: FontSelectionRequest::weight.
font_style: FontStyleFont style (normal/italic/oblique). Chrome: FontSelectionRequest::slope.
font_family: StringFont family name (comma-separated CSS string).
letter_spacing: f32CSS letter-spacing in px. 0.0 = normal.
Chrome: FontDescription::LetterSpacing().
word_spacing: f32CSS word-spacing in px. 0.0 = normal.
Chrome: FontDescription::WordSpacing().
Implementations§
Source§impl FontQuery
impl FontQuery
Sourcepub fn new(
font_size: f32,
font_weight: u16,
font_style: ParleyFontStyle,
font_family: String,
) -> Self
pub fn new( font_size: f32, font_weight: u16, font_style: ParleyFontStyle, font_family: String, ) -> Self
Create a query from full properties.
Sourcepub fn from_size(font_size: f32) -> Self
pub fn from_size(font_size: f32) -> Self
Create a query with just font size (default weight + sans-serif).
Sourcepub fn from_computed(cv: &ComputedValues) -> Self
pub fn from_computed(cv: &ComputedValues) -> Self
Create from Stylo ComputedValues.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FontQuery
impl RefUnwindSafe for FontQuery
impl Send for FontQuery
impl Sync for FontQuery
impl Unpin for FontQuery
impl UnsafeUnpin for FontQuery
impl UnwindSafe for FontQuery
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> 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> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert