pub struct SelectionFlags { /* private fields */ }
Expand description
OS/2 selection flags
Implementations§
Source§impl SelectionFlags
impl SelectionFlags
Sourcepub const ITALIC: SelectionFlags
pub const ITALIC: SelectionFlags
Bit 0: Font contains italic or oblique glyphs, otherwise they are upright.
Sourcepub const UNDERSCORE: SelectionFlags
pub const UNDERSCORE: SelectionFlags
Bit 1: Glyphs are underscored.
Sourcepub const NEGATIVE: SelectionFlags
pub const NEGATIVE: SelectionFlags
Bit 2: Glyphs have their foreground and background reversed.
Sourcepub const OUTLINED: SelectionFlags
pub const OUTLINED: SelectionFlags
Bit 3: Outline (hollow) glyphs, otherwise they are solid.
Sourcepub const STRIKEOUT: SelectionFlags
pub const STRIKEOUT: SelectionFlags
Bit 4: Glyphs are overstruck.
Sourcepub const BOLD: SelectionFlags
pub const BOLD: SelectionFlags
Bit 5: Glyphs are emboldened.
Sourcepub const REGULAR: SelectionFlags
pub const REGULAR: SelectionFlags
Bit 6: Glyphs are in the standard weight/style for the font.
Sourcepub const USE_TYPO_METRICS: SelectionFlags
pub const USE_TYPO_METRICS: SelectionFlags
Bit 7: If set, it is strongly recommended that applications use OS/2.sTypoAscender - OS/2.sTypoDescender + OS/2.sTypoLineGap as the default line spacing for this font.
Sourcepub const WWS: SelectionFlags
pub const WWS: SelectionFlags
Bit 8: The font has ‘name’ table strings consistent with a weight/width/slope family without requiring use of name IDs 21 and 22.
Sourcepub const OBLIQUE: SelectionFlags
pub const OBLIQUE: SelectionFlags
Bit 9: Font contains oblique glyphs.
Source§impl SelectionFlags
impl SelectionFlags
Sourcepub const fn empty() -> SelectionFlags
pub const fn empty() -> SelectionFlags
Returns an empty set of flags.
Sourcepub const fn all() -> SelectionFlags
pub const fn all() -> SelectionFlags
Returns the set containing all flags.
Sourcepub const fn from_bits(bits: u16) -> Option<SelectionFlags>
pub const fn from_bits(bits: u16) -> Option<SelectionFlags>
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) -> SelectionFlags
pub const fn from_bits_truncate(bits: u16) -> SelectionFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const fn intersects(&self, other: SelectionFlags) -> bool
pub const fn intersects(&self, other: SelectionFlags) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: SelectionFlags) -> bool
pub const fn contains(&self, other: SelectionFlags) -> bool
Returns true
if all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: SelectionFlags)
pub fn insert(&mut self, other: SelectionFlags)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: SelectionFlags)
pub fn remove(&mut self, other: SelectionFlags)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: SelectionFlags)
pub fn toggle(&mut self, other: SelectionFlags)
Toggles the specified flags in-place.
Sourcepub const fn intersection(self, other: SelectionFlags) -> SelectionFlags
pub const fn intersection(self, other: SelectionFlags) -> SelectionFlags
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: SelectionFlags) -> SelectionFlags
pub const fn union(self, other: SelectionFlags) -> SelectionFlags
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: SelectionFlags) -> SelectionFlags
pub const fn difference(self, other: SelectionFlags) -> SelectionFlags
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 Binary for SelectionFlags
impl Binary for SelectionFlags
Source§impl BitAnd for SelectionFlags
impl BitAnd for SelectionFlags
Source§fn bitand(self, other: SelectionFlags) -> SelectionFlags
fn bitand(self, other: SelectionFlags) -> SelectionFlags
Returns the intersection between the two sets of flags.
Source§type Output = SelectionFlags
type Output = SelectionFlags
&
operator.Source§impl BitAndAssign for SelectionFlags
impl BitAndAssign for SelectionFlags
Source§fn bitand_assign(&mut self, other: SelectionFlags)
fn bitand_assign(&mut self, other: SelectionFlags)
Disables all flags disabled in the set.
Source§impl BitOr for SelectionFlags
impl BitOr for SelectionFlags
Source§fn bitor(self, other: SelectionFlags) -> SelectionFlags
fn bitor(self, other: SelectionFlags) -> SelectionFlags
Returns the union of the two sets of flags.
Source§type Output = SelectionFlags
type Output = SelectionFlags
|
operator.Source§impl BitOrAssign for SelectionFlags
impl BitOrAssign for SelectionFlags
Source§fn bitor_assign(&mut self, other: SelectionFlags)
fn bitor_assign(&mut self, other: SelectionFlags)
Adds the set of flags.
Source§impl BitXor for SelectionFlags
impl BitXor for SelectionFlags
Source§fn bitxor(self, other: SelectionFlags) -> SelectionFlags
fn bitxor(self, other: SelectionFlags) -> SelectionFlags
Returns the left flags, but with all the right flags toggled.
Source§type Output = SelectionFlags
type Output = SelectionFlags
^
operator.Source§impl BitXorAssign for SelectionFlags
impl BitXorAssign for SelectionFlags
Source§fn bitxor_assign(&mut self, other: SelectionFlags)
fn bitxor_assign(&mut self, other: SelectionFlags)
Toggles the set of flags.
Source§impl Clone for SelectionFlags
impl Clone for SelectionFlags
Source§fn clone(&self) -> SelectionFlags
fn clone(&self) -> SelectionFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SelectionFlags
impl Debug for SelectionFlags
Source§impl Default for SelectionFlags
impl Default for SelectionFlags
Source§fn default() -> SelectionFlags
fn default() -> SelectionFlags
Source§impl<'de> Deserialize<'de> for SelectionFlags
impl<'de> Deserialize<'de> for SelectionFlags
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SelectionFlags, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SelectionFlags, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl FontWrite for SelectionFlags
impl FontWrite for SelectionFlags
Source§fn write_into(&self, writer: &mut TableWriter)
fn write_into(&self, writer: &mut TableWriter)
Source§fn table_type(&self) -> TableType
fn table_type(&self) -> TableType
Source§impl Hash for SelectionFlags
impl Hash for SelectionFlags
Source§impl LowerHex for SelectionFlags
impl LowerHex for SelectionFlags
Source§impl Not for SelectionFlags
impl Not for SelectionFlags
Source§fn not(self) -> SelectionFlags
fn not(self) -> SelectionFlags
Returns the complement of this set of flags.
Source§type Output = SelectionFlags
type Output = SelectionFlags
!
operator.Source§impl Octal for SelectionFlags
impl Octal for SelectionFlags
Source§impl Ord for SelectionFlags
impl Ord for SelectionFlags
Source§fn cmp(&self, other: &SelectionFlags) -> Ordering
fn cmp(&self, other: &SelectionFlags) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SelectionFlags
impl PartialEq for SelectionFlags
Source§impl PartialOrd for SelectionFlags
impl PartialOrd for SelectionFlags
Source§impl Scalar for SelectionFlags
impl Scalar for SelectionFlags
Source§fn from_raw(raw: <SelectionFlags as Scalar>::Raw) -> SelectionFlags
fn from_raw(raw: <SelectionFlags as Scalar>::Raw) -> SelectionFlags
Source§impl Serialize for SelectionFlags
impl Serialize for SelectionFlags
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl Sub for SelectionFlags
impl Sub for SelectionFlags
Source§fn sub(self, other: SelectionFlags) -> SelectionFlags
fn sub(self, other: SelectionFlags) -> SelectionFlags
Returns the set difference of the two sets of flags.
Source§type Output = SelectionFlags
type Output = SelectionFlags
-
operator.Source§impl SubAssign for SelectionFlags
impl SubAssign for SelectionFlags
Source§fn sub_assign(&mut self, other: SelectionFlags)
fn sub_assign(&mut self, other: SelectionFlags)
Disables all flags enabled in the set.
Source§impl UpperHex for SelectionFlags
impl UpperHex for SelectionFlags
impl AnyBitPattern for SelectionFlags
impl Copy for SelectionFlags
impl Eq for SelectionFlags
impl StructuralPartialEq for SelectionFlags
Auto Trait Implementations§
impl Freeze for SelectionFlags
impl RefUnwindSafe for SelectionFlags
impl Send for SelectionFlags
impl Sync for SelectionFlags
impl Unpin for SelectionFlags
impl UnwindSafe for SelectionFlags
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
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> FixedSize for Twhere
T: Scalar,
impl<T> FixedSize for Twhere
T: Scalar,
Source§const RAW_BYTE_LEN: usize
const RAW_BYTE_LEN: usize
Source§impl<T> FromObjRef<BigEndian<T>> for T
impl<T> FromObjRef<BigEndian<T>> for T
Source§fn from_obj_ref(from: &BigEndian<T>, _: FontData<'_>) -> T
fn from_obj_ref(from: &BigEndian<T>, _: FontData<'_>) -> T
from
to an instance of Self
, using the provided data to resolve offsets.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T
, using the provided data to resolve any offsets.