pub struct RankKey {
pub deficit: u32,
pub style: i32,
pub italic: u8,
pub dedication_inv: u64,
pub breadth: u64,
pub name: String,
}Expand description
The ordering used wherever font candidates compete. Smaller is better.
Fields§
§deficit: u32Number of requested codepoints the font does not cover.
style: i32Style score against the request (smaller is closer).
italic: u80 for upright, 1 for italic (prefers upright on ties).
dedication_inv: u64How much of the font’s coverage lies outside the requested block (prefers dedicated fonts).
breadth: u64Total codepoint coverage (prefers narrower fonts on ties).
name: StringFont name, for deterministic tie-breaking.
Implementations§
Source§impl RankKey
impl RankKey
Sourcepub fn for_block(
style: &FcPattern,
candidate: &FcPattern,
block: &UnicodeRange,
) -> Option<Self>
pub fn for_block( style: &FcPattern, candidate: &FcPattern, block: &UnicodeRange, ) -> Option<Self>
Rank candidate for characters of block under style. None when
the candidate covers nothing of the block.
Sourcepub fn for_style(style: &FcPattern, candidate: &FcPattern) -> Self
pub fn for_style(style: &FcPattern, candidate: &FcPattern) -> Self
Rank candidate based only on style. Narrower fonts win ties.
Sourcepub fn for_request(
style: &FcPattern,
candidate: &FcPattern,
requested: &[UnicodeRange],
) -> Self
pub fn for_request( style: &FcPattern, candidate: &FcPattern, requested: &[UnicodeRange], ) -> Self
Rank candidate against a requested range set by style and missing coverage.
Trait Implementations§
impl Eq for RankKey
Source§impl Ord for RankKey
impl Ord for RankKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for RankKey
impl PartialOrd for RankKey
impl StructuralPartialEq for RankKey
Auto Trait Implementations§
impl Freeze for RankKey
impl RefUnwindSafe for RankKey
impl Send for RankKey
impl Sync for RankKey
impl Unpin for RankKey
impl UnsafeUnpin for RankKey
impl UnwindSafe for RankKey
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