#[repr(transparent)]pub struct Flags {
bits: u16,
}
Expand description
The flags
field for the head table.
Fields§
§bits: u16
Implementations§
Source§impl Flags
impl Flags
Sourcepub const BASELINE_AT_Y_0: Self
pub const BASELINE_AT_Y_0: Self
Bit 0: Baseline for font at y=0.
Sourcepub const LSB_AT_X_0: Self
pub const LSB_AT_X_0: Self
Bit 1: Left sidebearing point at x=0 (relevant only for TrueType rasterizers).
Sourcepub const INSTRUCTIONS_MAY_DEPEND_ON_POINT_SIZE: Self
pub const INSTRUCTIONS_MAY_DEPEND_ON_POINT_SIZE: Self
Bit 2: Instructions may depend on point size.
Sourcepub const FORCE_INTEGER_PPEM: Self
pub const FORCE_INTEGER_PPEM: Self
Bit 3: Force ppem to integer values for all internal scaler math; may use fractional ppem sizes if this bit is clear. It is strongly recommended that this be set in hinted fonts.
Sourcepub const INSTRUCTIONS_MAY_ALTER_ADVANCE_WIDTH: Self
pub const INSTRUCTIONS_MAY_ALTER_ADVANCE_WIDTH: Self
Bit 4: Instructions may alter advance width (the advance widths might not scale linearly).
Sourcepub const LOSSLESS_TRANSFORMED_FONT_DATA: Self
pub const LOSSLESS_TRANSFORMED_FONT_DATA: Self
Bit 11: Font data is “lossless” as a result of having been subjected to optimizing transformation and/or compression (such as compression mechanisms defined by ISO/IEC 14496-18, MicroType® Express, WOFF 2.0, or similar) where the original font functionality and features are retained but the binary compatibility between input and output font files is not guaranteed. As a result of the applied transform, the DSIG table may also be invalidated.
Sourcepub const CONVERTED_FONT: Self
pub const CONVERTED_FONT: Self
Bit 12: Font converted (produce compatible metrics).
Sourcepub const OPTIMIZED_FOR_CLEARTYPE: Self
pub const OPTIMIZED_FOR_CLEARTYPE: Self
Bit 13: Font optimized for ClearType. Note, fonts that rely on embedded bitmaps (EBDT) for rendering should not be considered optimized for ClearType, and therefore should keep this bit cleared.
Sourcepub const LAST_RESORT_FONT: Self
pub const LAST_RESORT_FONT: Self
Bit 14: Last Resort font. If set, indicates that the glyphs encoded in the ‘cmap’ subtables are simply generic symbolic representations of code point ranges and do not truly represent support for those code points. If unset, indicates that the glyphs encoded in the ‘cmap’ subtables represent proper support for those code points.
Source§impl Flags
impl Flags
Sourcepub const fn from_bits(bits: u16) -> Option<Self>
pub const fn from_bits(bits: u16) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u16) -> Self
pub const fn from_bits_truncate(bits: u16) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both.
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
Trait Implementations§
Source§impl BitAndAssign for Flags
impl BitAndAssign for Flags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
Source§impl BitOrAssign for Flags
impl BitOrAssign for Flags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
Source§impl BitXorAssign for Flags
impl BitXorAssign for Flags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
Source§impl Ord for Flags
impl Ord for Flags
Source§impl PartialOrd for Flags
impl PartialOrd for Flags
Source§impl SubAssign for Flags
impl SubAssign for Flags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.
impl AnyBitPattern for Flags
impl Copy for Flags
impl Eq for Flags
impl StructuralPartialEq for Flags
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnwindSafe for Flags
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.