Table of Contents

Struct FontStyle

Namespace
Xui.Core.Canvas
Assembly
Core.dll

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 bool

Whether the font is italic.

oblique bool

Whether the font is oblique (slanted).

obliqueAngle NFloat

Angle for oblique style, in degrees.

Properties

IsItalic

Gets a value indicating whether the font style is italic.

public bool IsItalic { get; }

Property Value

bool

IsOblique

Gets a value indicating whether the font style is oblique (slanted).

public bool IsOblique { get; }

Property Value

bool

Italic

Italic font style.

public static FontStyle Italic { get; }

Property Value

FontStyle

Normal

Normal (upright) font style.

public static FontStyle Normal { get; }

Property Value

FontStyle

Oblique

Oblique font style using the default slant angle (14°).

public static FontStyle Oblique { get; }

Property Value

FontStyle

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

NFloat

Methods

CustomOblique(NFloat)

Creates a custom oblique font style with a specific slant angle.

public static FontStyle CustomOblique(NFloat obliqueAngle)

Parameters

obliqueAngle NFloat

The angle of the slant, in degrees. Should be between -90 and 90.

Returns

FontStyle

A FontStyle representing the custom oblique angle.