Fonts
A Font groups script-specific FontParts (Latin, East Asia, Complex Script, High ANSI) and typography options such as size, kerning, underline, strike-through, and emphasis marks.
Basic Font Setup
Use case: Set family, size, and weight for a text run.
C#
1var font = new Font
2{
3 Latin = new FontPart
4 {
5 FontName = "Calibri",
6 Size = new FontSize(12),
7 IsBold = true,
8 IsItalic = false,
9 },
10Color = Color.Black,
11};
Underline and Strike-Through
Use case: Mark revised or deleted text.
C#
1var font = new Font
2{
3 Latin = new FontPart { FontName = "Consolas", Size = new FontSize(11) },
4 Underline = new Underline
5 {
6 LineValue = UnderlineValues.Dotted,
7 Color = Color.Gray,
8 },
9Strike = StrikValue.SingleStrike,
10};
Kerning and Character Spacing
Use case: Fine-tune character spacing and enable kerning.
C#
1var font = new Font
2{
3 Latin = new FontPart { FontName = "Georgia", Size = new FontSize(14) },
4 Kerning = new FontSize(12),
5 Spacing = new DocumentUnit(0.5, Units.pt),
6 Scale = new Percentage(100),
7};
Frequently asked questions
How do I specify fonts for different scripts?
Use Latin, EastAsia, ComplexScriptFont, and HighAnsi to set the family for each script.
Where do I set font size — on Font or FontPart?
Both work. FontPart.Size controls per-script size; Font.Kerning sets a kerning size. Most common: put size on the FontPart.