TextStyle.TextStyle

TextStyle()

Initializes a new instance of the TextStyle class with default settings.

public TextStyle()

Examples

Shows how to customize text styles which are used to style different text items in a project.

var project = new Project(DataDir + "CreateProject2.mpp");
SaveOptions options = new PdfSaveOptions
{
    PresentationFormat = PresentationFormat.ResourceSheet
};

var style = new TextStyle();
style.Color = Color.OrangeRed;
style.Font = new FontDescriptor(FontFamily.GenericMonospace.Name, 10F, FontStyles.Bold | FontStyles.Italic);
style.ItemType = TextItemType.OverallocatedResources;
style.BackgroundColor = Color.Aqua;
style.BackgroundPattern = BackgroundPattern.DarkDither;

options.TextStyles = new List<TextStyle>
{
    style
};
project.Save(OutDir + "CustomizeTextStyle_out.pdf", options);

See Also


TextStyle(float, FontStyles)

Initializes a new instance of the TextStyle class with the default font and specified font size and style.

public TextStyle(float fontSize, FontStyles fontStyle)
ParameterTypeDescription
fontSizeSingleSize of font of TextStyle.
fontStyleFontStylesStyle of font of TextStyle.

See Also


TextStyle(FontStyles)

Initializes a new instance of the TextStyle class with the default font and specified font style.

public TextStyle(FontStyles fontStyle)
ParameterTypeDescription
fontStyleFontStylesStyle of font to apply to default font.

See Also


TextStyle(FontDescriptor)

Initializes a new instance of the TextStyle class with the specified font settings.

public TextStyle(FontDescriptor font)
ParameterTypeDescription
fontFontDescriptorFont of the TextStyle.

See Also