pub struct Query { /* private fields */ }Expand description
Filter criteria for font search.
Built via chained with_* methods. An empty query matches all fonts.
Implementations§
Source§impl Query
impl Query
pub fn new() -> Self
pub fn with_axes(self, axes: Vec<Tag>) -> Self
pub fn with_features(self, features: Vec<Tag>) -> Self
pub fn with_scripts(self, scripts: Vec<Tag>) -> Self
pub fn with_tables(self, tables: Vec<Tag>) -> Self
pub fn with_name_patterns(self, patterns: Vec<Regex>) -> Self
pub fn with_codepoints(self, cps: Vec<char>) -> Self
pub fn require_variable(self, yes: bool) -> Self
pub fn with_weight_range(self, range: Option<RangeInclusive<u16>>) -> Self
pub fn with_width_range(self, range: Option<RangeInclusive<u16>>) -> Self
pub fn with_family_class(self, class: Option<FamilyClassFilter>) -> Self
pub fn with_creator_patterns(self, patterns: Vec<Regex>) -> Self
pub fn with_license_patterns(self, patterns: Vec<Regex>) -> Self
Sourcepub fn name_patterns(&self) -> &[Regex]
pub fn name_patterns(&self) -> &[Regex]
Get the name patterns.
Sourcepub fn codepoints(&self) -> &[char]
pub fn codepoints(&self) -> &[char]
Get the required codepoints.
Sourcepub fn requires_variable(&self) -> bool
pub fn requires_variable(&self) -> bool
Check if variable fonts are required.
Sourcepub fn weight_range(&self) -> Option<&RangeInclusive<u16>>
pub fn weight_range(&self) -> Option<&RangeInclusive<u16>>
Get the weight range filter.
Sourcepub fn width_range(&self) -> Option<&RangeInclusive<u16>>
pub fn width_range(&self) -> Option<&RangeInclusive<u16>>
Get the width range filter.
Sourcepub fn family_class(&self) -> Option<&FamilyClassFilter>
pub fn family_class(&self) -> Option<&FamilyClassFilter>
Get the family class filter.
Sourcepub fn creator_patterns(&self) -> &[Regex]
pub fn creator_patterns(&self) -> &[Regex]
Get the creator patterns.
Sourcepub fn license_patterns(&self) -> &[Regex]
pub fn license_patterns(&self) -> &[Regex]
Get the license patterns.
Sourcepub fn matches(&self, meta: &TypgFontFaceMeta) -> bool
pub fn matches(&self, meta: &TypgFontFaceMeta) -> bool
Returns true if meta satisfies all criteria in this query.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
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 more