TextConfig
Contents
[
Hide
]
This element is used to add a line of text to the form. TextConfig elements cannot be nested within other elements - they should always be placed directly in the Children
list of the PageConfig
object.
Declaration
TextConfig element is declared as an instance of TextConfig
class. Reference Aspose.OMR.Generation.Config.Elements
and Aspose.OMR.Generation.Config.Enums
namespaces to use TextConfig
types without specifying the fully qualified namespace:
using Aspose.OMR.Generation.Config.Elements;
using Aspose.OMR.Generation.Config.Enums;
The text displayed in the form is specified in the Name
property.
new TextConfig() {
Name = "Text goes here"
}
Required properties
Name | Type | Description |
---|---|---|
Name | string |
A line of text displayed in the form. |
Optional properties
Name | Type | Default value | Description |
---|---|---|---|
FontFamily | string |
“Segoe UI” | The font family for the text. |
FontStyle | FontStyle |
FontStyle.Regular |
The font style for a text. Several font styles can be combined with | operator, for example FontStyle.Bold | FontStyle.Italic . |
FontSize | int |
12 | Font size for the text. |
Color | Color |
Color.Black |
Text color. |
TextAlignment | AlignmentEnum |
AlignmentEnum.Left |
Horizontal text alignment. |
Allowed child elements
None.
Example
TemplateConfig templateConfig = new TemplateConfig() {
Children=new List<BaseConfig>() {
new PageConfig() {
Children = new List<BaseConfig>() {
new TextConfig() {
Name = "Once upon a midnight dreary, while I pondered, weak and weary,",
FontFamily = "Courier New",
FontStyle = FontStyle.Bold | FontStyle.Italic,
TextAlignment = AlignmentEnum.Center
},
new TextConfig() {
Name = "Over many a quaint and curious volume of forgotten lore-",
FontFamily = "Courier New",
FontStyle = FontStyle.Bold | FontStyle.Italic,
TextAlignment = AlignmentEnum.Center
},
new TextConfig() {
Name = "While I nodded, nearly napping, suddenly there came a tapping,",
FontFamily = "Courier New",
FontStyle = FontStyle.Bold | FontStyle.Italic,
TextAlignment = AlignmentEnum.Center
},
new TextConfig() {
Name = "As of some one gently rapping, rapping at my chamber door.",
FontFamily = "Courier New",
FontStyle = FontStyle.Bold | FontStyle.Italic,
TextAlignment = AlignmentEnum.Center
}
}
}
}
};