SceneFont Struct

The size, the weight, the style and the family of a text.

public readonly struct SceneFont : IEquatable<SceneFont>
Implements

Constructors

NameDescription
SceneFont(double, int, bool, string?)The size, the weight, the style and the family of a text.

SceneFont(double, int, bool, string?)

The size, the weight, the style and the family of a text.

public SceneFont(double Size, int Weight = 400, bool Italic = false, string? Family = null)

Parameters

Size double
The size of the font, in pixels.
Weight int
The weight of the font, from 1 to 1000, as in CSS: SceneFont.NormalWeight (400) for regular text, SceneFont.BoldWeight (700) for bold text. The fonts of a scene draw the text with the face of the nearest weight; the renderers without fonts draw the weights from 600 as bold.
Italic bool
Whether the text is italic.
Family string?
The family of the text, as a CSS font-family value, or null for the family of the drawing (Scene.FontFamily). With fonts (Scene.Fonts), the first family of the list that the collection has draws the text, and the default family of the collection when it has none of them.

Properties

NameDescription
FamilyThe family of the text, as a CSS font-family value, or null for the family of the drawing (Scene.FontFamily). With fonts (Scene.Fonts), the first family of the list that the collection has draws the text, and the default family of the collection when it has none of them.
IsBoldGets a value that indicates whether the weight is bold: 600 or more, as CSS chooses between a regular and a bold face.
ItalicWhether the text is italic.
SizeThe size of the font, in pixels.
WeightThe weight of the font, from 1 to 1000, as in CSS: SceneFont.NormalWeight (400) for regular text, SceneFont.BoldWeight (700) for bold text. The fonts of a scene draw the text with the face of the nearest weight; the renderers without fonts draw the weights from 600 as bold.

The family of the text, as a CSS font-family value, or null for the family of the drawing (Scene.FontFamily). With fonts (Scene.Fonts), the first family of the list that the collection has draws the text, and the default family of the collection when it has none of them.

public string? Family { get; init; }

Property value

string?

Gets a value that indicates whether the weight is bold: 600 or more, as CSS chooses between a regular and a bold face.

public bool IsBold { get; }

Property value

bool

Whether the text is italic.

public bool Italic { get; init; }

Property value

bool

The size of the font, in pixels.

public double Size { get; init; }

Property value

double

The weight of the font, from 1 to 1000, as in CSS: SceneFont.NormalWeight (400) for regular text, SceneFont.BoldWeight (700) for bold text. The fonts of a scene draw the text with the face of the nearest weight; the renderers without fonts draw the weights from 600 as bold.

public int Weight { get; init; }

Property value

int

Methods

NameDescription
Deconstruct(double, int, bool, string?)
Equals(SceneFont)
Equals(object)
GetHashCode()
ToString()

Deconstruct(double, int, bool, string?)

public void Deconstruct(out double Size, out int Weight, out bool Italic, out string? Family)

Parameters

Size double
Weight int
Italic bool
Family string?

No documentation is available.

Equals overloads

Equals(SceneFont)

public bool Equals(SceneFont other)
Parameters
other SceneFont
Returns

bool

No documentation is available.

Equals(object)

public override bool Equals(object obj)
Parameters
obj object
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(SceneFont, SceneFont)
operator !=(SceneFont, SceneFont)

operator ==(SceneFont, SceneFont)

public static bool operator ==(SceneFont left, SceneFont right)

Parameters

left SceneFont
right SceneFont

Returns

bool

No documentation is available.

operator !=(SceneFont, SceneFont)

public static bool operator !=(SceneFont left, SceneFont right)

Parameters

left SceneFont
right SceneFont

Returns

bool

No documentation is available.

Constants

NameDescription
BoldWeightThe weight of bold text.
NormalWeightThe weight of regular text.

BoldWeight

The weight of bold text.

public const int BoldWeight = 700

NormalWeight

The weight of regular text.

public const int NormalWeight = 400