Struct FontStyle
Represents a web-like font style, supporting normal
, italic
, and oblique
variations.
Global CSS styles like inherit
, unset
, and initial
are not supported.
Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
public struct FontStyle
- Inherited Members
Constructors
FontStyle(bool, bool, NFloat)
Initializes a new FontStyle with explicit flags for italic or oblique styling.
public FontStyle(bool italic, bool oblique, NFloat obliqueAngle)
Parameters
italic
boolWhether the font is italic.
oblique
boolWhether the font is oblique (slanted).
obliqueAngle
NFloatAngle for oblique style, in degrees.
Properties
IsItalic
Gets a value indicating whether the font style is italic.
public bool IsItalic { get; }
Property Value
IsOblique
Gets a value indicating whether the font style is oblique (slanted).
public bool IsOblique { get; }
Property Value
Italic
Italic font style.
public static FontStyle Italic { get; }
Property Value
Normal
Normal (upright) font style.
public static FontStyle Normal { get; }
Property Value
Oblique
Oblique font style using the default slant angle (14°).
public static FontStyle Oblique { get; }
Property Value
ObliqueAngle
Gets the oblique slant angle, in degrees. Only meaningful if IsOblique is true. Range is typically from -90° to 90°.
public NFloat ObliqueAngle { get; }
Property Value
Methods
CustomOblique(NFloat)
Creates a custom oblique font style with a specific slant angle.
public static FontStyle CustomOblique(NFloat obliqueAngle)
Parameters
obliqueAngle
NFloatThe angle of the slant, in degrees. Should be between -90 and 90.