VegaRise.NET
HomeAPI Reference
Back to DOM

FontPartClass

Definition

Namespace
DOM.Abstracts
Assembly
DOM.dll

Represents the per-script font configuration (family, size, weight, italic, theme hint) for a text run.

Remarks

is the unit of font selection in the DOM. A aggregates up to four instances (Latin, East Asia, Complex Script, High ANSI) so that each script category can select its own family and size. The property allows the part to reference a theme-defined font slot instead of a concrete family name. FontPart FontPart Font Theme All properties are nullable so callers can distinguish "not specified" from an explicit value; when a property is, consumers should fall back to the inherited or document-default value. null

Examples

csharp
1// 1. Simple Latin font part
2var part = new FontPart("Calibri", 11.0);
3
csharp
1// 2. Bold italic Latin font part
2var part = new FontPart("Times New Roman", 12.0, bold: true, italic: true);
3
csharp
1// 3. Theme-driven font part
2var part = new FontPart { Theme = ThemeFontValues.majorHAnsi, Size = 14.0 };
3
csharp
1// 4. East Asia / Complex Script font parts in a Font
2var font = new Font
3{
4 Latin = new FontPart("Arial", 11.0),
5 EastAsia = new FontPart("Microsoft YaHei", 11.0),
6 ComplexScriptFont = new FontPart("Arial", 11.0)
7};
8
csharp
1// 5. Change only the size of an existing font part
2part.Size = new FontSize(14.0);
3

Constructors

FontPart()

Initializes a new with default (unspecified) values. FontPart

FontPart(string fontName, double size, bool bold, bool italic)

Initializes a new with the given font name, size, and optional bold/italic. FontPart

Properties

FontName

Gets or sets the name of the font family.

IsBold

Gets or sets whether the font should be bold.

IsItalic

Gets or sets whether the font should be italic.

Gets or sets the size of the font for this script category.

Gets or sets a theme font slot to use in place of a concrete font family.