SceneFont Struct
The size, the weight, the style and the family of a text.
public readonly struct SceneFont : IEquatable<SceneFont>- Implements
Constructors
| Name | Description |
|---|---|
| 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.
Parameters
Sizedouble- The size of the font, in pixels.
Weightint- 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. Italicbool- Whether the text is italic.
Familystring?- The family of the text, as a CSS
font-familyvalue, ornullfor 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
| Name | Description |
|---|---|
| Family | 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. |
| IsBold | Gets a value that indicates whether the weight is bold: 600 or more, as CSS chooses between a regular and a bold face. |
| Italic | Whether the text is italic. |
| Size | The size of the font, in pixels. |
| Weight | 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. |
Family
SceneFont.csThe 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
IsBold
SceneFont.csItalic
SceneFont.csSize
SceneFont.csWeight
SceneFont.csThe 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
Methods
| Name | Description |
|---|---|
| Deconstruct(double, int, bool, string?) | |
| Equals(SceneFont) | |
| Equals(object) | |
| GetHashCode() | |
| ToString() |
Deconstruct(double, int, bool, string?)
Equals overloads
Equals(SceneFont)
Equals(object)
GetHashCode()
ToString()
Operators
| Name | Description |
|---|---|
| operator ==(SceneFont, SceneFont) | |
| operator !=(SceneFont, SceneFont) |
operator ==(SceneFont, SceneFont)
operator !=(SceneFont, SceneFont)
Constants
| Name | Description |
|---|---|
| BoldWeight | The weight of bold text. |
| NormalWeight | The weight of regular text. |
BoldWeight
The weight of bold text.
public const int BoldWeight = 700NormalWeight
The weight of regular text.
public const int NormalWeight = 400