VegaRise.NET
Back to DOM

FontSizeClass

Definition

Namespace
DOM.MeasurementUnits
Assembly
DOM.dll

Represents a font-size measurement specialized from . DocumentUnit

Remarks

provides a convenient abstraction for working with font sizes while internally storing all values in EMUs via . FontSize DocumentUnit In addition to standard unit-based construction, this type exposes a half-point based accessor () to align with WordprocessingML and other document formats that represent font sizes using half-points. HalfPoint Use wherever a font size is required — for example on and . FontSize FontPart.Size Font.Kerning

Examples

csharp
1// 1. Create from points
2var size = new FontSize(12.0);
3Console.WriteLine(size.Point); // 12
4
csharp
1// 2. Use implicit conversion when assigning to a FontPart
2var font = new Font
3{
4 Latin = new FontPart { FontName = "Calibri", Size = 11.0 } // 11 pt
5};
6
csharp
1// 3. Set via half-points (WordprocessingML compatibility)
2var size = new FontSize { HalfPoint = 24 }; // 12 points
3Console.WriteLine(size.Point); // 12
4
csharp
1// 4. Read half-points from a point-based size
2var size = new FontSize(14.0);
3Console.WriteLine(size.HalfPoint); // 28
4

Constructors

FontSize()

Initializes a new instance with no value set. FontSize

FontSize(double size)

Initializes a new instance from a point-based font size. FontSize

Properties

HalfPointint

Gets or sets the font size expressed in half-points.

This property is primarily intended for compatibility with document formats (such as WordprocessingML) that encode font sizes using half-point units. A value indicates that the font size is not explicitly set. null

Methods

Implicitly converts a point-based value to a . Double, FontSize

VegaRiseVDocs.NET

Reset Password

Enter your email and we'll send you a link to reset your password.

Remember your password? Sign in