pub struct Coverage {
pub covered: u8,
pub total: u8,
}Expand description
A font’s coverage of a character cluster.
This is the fraction covered / total of characters covered by a font. Coverages are ordered by
the value of the fraction (with 0 / 0 considered to be completely covered). Use, e.g.,
Self::cmp to compare coverages.
In the unlikely event there are more characters than this in the character cluster, the counts
are saturated to u8::MAX.
Fields§
§covered: u8The number of characters covered by the font.
total: u8The number of characters counting towards coverage.
Implementations§
Source§impl Coverage
impl Coverage
Sourcepub const NONE: Self
pub const NONE: Self
Zero coverage.
Useful, for example, as a starting “best coverage,” in case you’re searching for a best-covering font.
Sourcepub const COMPLETE: Self
pub const COMPLETE: Self
Complete coverage, meaning all characters contributing to shaping are covered.
A coverage compares equal to COMPLETE exactly when it is complete, see also
Self::is_complete.
Sourcepub fn is_complete(self) -> bool
pub fn is_complete(self) -> bool
Returns true iff all characters are covered.
Trait Implementations§
impl Copy for Coverage
impl Eq for Coverage
Source§impl Ord for Coverage
impl Ord for Coverage
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Coverages are ordered by the value of the fraction covered / total.