Document Styles
DocumentStyles stores the default style set, the collection of named built‑in styles, and available themes. It is exposed on VDocs.DocumentStyles.
C#
1using Vega;
2using Vega.DOM;
3
4var doc = new VDocs();
5
6// Default styles for the whole document
7doc.DocumentStyles.DocumentDefualtStyles = new DocumentDefualtStyles
8{
9 TextStyle = new TextStyle
10 {
11 Font = new Font
12 {
13 Latin = new FontPart { FontName = "Calibri", Size = new FontSize(11) },
14 Color = Color.Black,
15 }
16}
17};
18
19// Active theme (see the Theme topic)
20doc.SetActiveTheme("Office");
Related API
Frequently asked questions
How do I set a document-wide default font?
Assign a TextStyle to DocumentStyles.DocumentDefualtStyles.TextStyle.
Can I register my own named styles?
Yes — add a BuiltInStyle entry to DocumentStyles.DocumentBuiltInStyles.