VegaRise.NET
Back to DOM

FontClass

Definition

Namespace
DOM.Styles
Assembly
DOM.dll

Represents font (character) formatting for document text runs.

Remarks

aggregates font family selections (for different script types), typographic features (kerning, scaling, spacing), and text decorations (underline, strike). Most properties are nullable to allow callers to distinguish "not specified" from an explicit value; consumers should apply inheritance or fallback rules when a property is . Font null Fonts are consumed by and by the fluent objects that describe per-script font families. Font FontPart

Examples

csharp
1// 1. Simple Latin font
2var font = new Font
3{
4 Latin = new FontPart { FontName = "Calibri", Size = 11.0 }
5};
6
csharp
1// 2. Bold italic heading font with color
2var font = new Font
3{
4 Latin = new FontPart { FontName = "Calibri Light", Size = 24.0, IsBold = true, IsItalic = false },
5 Color = Color.DarkBlue
6};
7
csharp
1// 3. Multilingual font (Latin + CJK + complex script)
2var font = new Font
3{
4 Latin = new FontPart { FontName = "Arial", Size = 11.0 },
5 EastAsia = new FontPart { FontName = "Microsoft YaHei", Size = 11.0 },
6 ComplexScriptFont = new FontPart { FontName = "Arial", Size = 11.0 }
7};
8
csharp
1// 4. Font with underline and strike-through
2var font = new Font
3{
4 Latin = new FontPart { FontName = "Consolas", Size = 10.0 },
5 Underline = new Underline { LineValue = UnderlineValues.Dotted, Color = Color.Gray },
6 Strike = StrikValue.SingleStrike
7};
8
csharp
1// 5. Apply a horizontal scale (90%) and character spacing
2var font = new Font
3{
4 Latin = new FontPart { FontName = "Georgia", Size = 12.0 },
5 Scale = new Percentage(90),
6 Spacing = new DocumentUnit(0.25, Units.pt)
7};
8
csharp
1// 6. Use a constructor shortcut for a plain Latin font
2var font = new Font("Arial", 11.0, bold: true, italic: false);
3

Constructors

Font()

Initializes a new instance with default (unspecified) values. Font

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

Initializes a new with a Latin font family, size, and optional bold/italic. Font

Font(FontPart latin, FontPart eastAsia, FontPart complexScript, FontPart highAnsi)

Initializes a new with explicit Latin and East Asian font parts. Font

Properties

AllCaps

Gets or sets a value indicating whether text should be rendered in all capital letters.

Color

Gets or sets the text color.

ComplexScriptFont

Gets or sets the font part used for complex script languages (e.g., Arabic, Hebrew).

EastAsia

Gets or sets the East Asian font family (for CJK scripts).

Emboss

Gets or sets whether emboss effect should be applied to the text.

Emphasis

Gets or sets the emphasis mark (dot, circle, sesame, etc.) to use for the text.

HasOutline

Gets or sets a value indicating whether the font is outlined.

HasShadow

Gets or sets a value indicating whether the font has a shadow effect.

Hidden

Gets or sets whether the text is hidden (not visible in normal rendering).

HighAnsi

Gets or sets the High ANSI font part (legacy code-page behaviour).

Hint

Gets or sets a hint describing how the font should be selected or rendered on the target platform.

KerningFontSize

Gets or sets the font size used for kerning.

Use this to control precise point/half-point values and conversions handled by . FontSize

Gets or sets the Latin (Western) font family and related settings.

Position

Gets or sets the baseline position adjustment (positive moves text upward).

Gets or sets scaling for the font as a percentage of the normal width.

Use to indicate relative horizontal scaling (100 = normal). Percentage

SmallCaps

Gets or sets a value indicating whether text should be rendered in small caps.

Spacing

Gets or sets additional spacing between characters (typically positive to expand).

Strike

Gets or sets strike-through style (single, double, none).

Subscript

Gets or sets whether the text is rendered as subscript.

Superscript

Gets or sets whether the text is rendered as superscript.

Underline

Gets or sets underline style information for the font.

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.