FontStyles

FontStyles structure

Represents 4 possible styles of the font, used in the document: Regular, Bold, Italic, or Bold Italic

public struct FontStyles : IEquatable<FontStyles>

Constructors

Name Description
FontStyles(bool, bool) Creates one FontStyles instance from specified bold and italic flags

Properties

Name Description
IsBold { get; } Indicates whether this FontStyles instance has a bold flag enabled (true) or disabled (false)
IsItalic { get; } Indicates whether this FontStyles instance has an italic flag enabled (true) or disabled (false)
Name { get; } Name of this font style

Methods

Name Description
Equals(FontStyles) Indicates whether this FontStyles instance is equal to specified
override Equals(object) Indicates whether this FontStyles instance is equal to specified uncasted
override GetHashCode() Returns a hash-code of this instance
override ToString() Returns a name of this font style, same as Name
static TryParse(string, out FontStyles) Tries to parse specified raw string as a font style name
operator + Combines (merges) two specified font styles and produces new resultant font style, where flags are merged (union)
operator == Checks whether two FontStyles values are equal
explicit operator Casts specified FontStyles instance to the equivalint octet (8-bit bitfield) in [0..3] decimal range
operator != Checks whether two FontStyles values are not equal
operator - Subtracts second (subtrahend) specified font style from the first (minuend) specified font style and produces new resultant font style, where are present only those flags from the first operand, which are not found in the second operand (difference)

Fields

Name Description
static readonly Bold Bold font style (bold only, without italic)
static readonly BoldItalic BoldItalic font style (bold and italic together)
static readonly Italic Italic font style (italic only, without bold)
static readonly Regular Regular font style, default value (no bold and italic)

Remarks

Immutable struct with convenient API and combining operations

See Also