Interface IOfficeFont
Represents character formatting for text or a bullet.
Inherited Members
Namespace: Syncfusion.OfficeChart
Assembly: Syncfusion.OfficeChart.Portable.dll
Syntax
public interface IOfficeFont : IParentApplication, IOptimizedUpdate
Properties
Bold
Gets or sets a value that Determines whether the font in the specified text is bold.
Declaration
bool Bold { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the bold font style
chart.ChartTitleArea.Bold = true;
//Set the color of chart title area
chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
//Set the font name
chart.ChartTitleArea.FontName = "Calibri";
//Get if the chart area is auto color
bool autoColor = chart.ChartTitleArea.IsAutoColor;
//Set the italic font style
chart.ChartTitleArea.Italic = true;
//Set the underline property
chart.ChartTitleArea.Underline = OfficeUnderline.Double;
//Set the alignment
chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Color
Gets or sets the primary color of the object. Read / write OfficeKnownColors.
Declaration
OfficeKnownColors Color { get; set; }
Property Value
Type | Description |
---|---|
OfficeKnownColors |
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the bold font style
chart.ChartTitleArea.Bold = true;
//Set the color of chart title area
chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
//Set the font name
chart.ChartTitleArea.FontName = "Calibri";
//Get if the chart area is auto color
bool autoColor = chart.ChartTitleArea.IsAutoColor;
//Set the italic font style
chart.ChartTitleArea.Italic = true;
//Set the underline property
chart.ChartTitleArea.Underline = OfficeUnderline.Double;
//Set the alignment
chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
FontName
Gets or sets the name of the font.
Declaration
string FontName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the bold font style
chart.ChartTitleArea.Bold = true;
//Set the color of chart title area
chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
//Set the font name
chart.ChartTitleArea.FontName = "Calibri";
//Get if the chart area is auto color
bool autoColor = chart.ChartTitleArea.IsAutoColor;
//Set the italic font style
chart.ChartTitleArea.Italic = true;
//Set the underline property
chart.ChartTitleArea.Underline = OfficeUnderline.Double;
//Set the alignment
chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
IsAutoColor
Gets a value that Indicates whether color is automatically selected. Read-only.
Declaration
bool IsAutoColor { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the bold font style
chart.ChartTitleArea.Bold = true;
//Set the color of chart title area
chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
//Set the font name
chart.ChartTitleArea.FontName = "Calibri";
//Get if the chart area is auto color
bool autoColor = chart.ChartTitleArea.IsAutoColor;
//Set the italic font style
chart.ChartTitleArea.Italic = true;
//Set the underline property
chart.ChartTitleArea.Underline = OfficeUnderline.Double;
//Set the alignment
chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Italic
Gets or sets a value that determines the font style is italic or not.
Declaration
bool Italic { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the bold font style
chart.ChartTitleArea.Bold = true;
//Set the color of chart title area
chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
//Set the font name
chart.ChartTitleArea.FontName = "Calibri";
//Get if the chart area is auto color
bool autoColor = chart.ChartTitleArea.IsAutoColor;
//Set the italic font style
chart.ChartTitleArea.Italic = true;
//Set the underline property
chart.ChartTitleArea.Underline = OfficeUnderline.Double;
//Set the alignment
chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
MacOSOutlineFont
Gets or sets a value that indicates the font is an outline font.
Declaration
bool MacOSOutlineFont { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
MacOSShadow
Gets or sets a value that indicates the font is a shadow font.
Declaration
bool MacOSShadow { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
RGBColor
Gets / sets font color. Searches for the closest color in the presentation palette.
Declaration
Color RGBColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the size of text area
chart.ChartTitleArea.Size = 32;
//Set the RGB color
chart.ChartTitleArea.RGBColor = System.Drawing.Color.Peru;
//Set strike through
chart.ChartTitleArea.Strikethrough = true;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Size
Gets or sets the character size, in points.
Declaration
double Size { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the size of text area
chart.ChartTitleArea.Size = 32;
//Set the RGB color
chart.ChartTitleArea.RGBColor = System.Drawing.Color.Peru;
//Set strike through
chart.ChartTitleArea.Strikethrough = true;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Strikethrough
Gets or sets a value that indicates the font is struck through with a horizontal line or not.
Declaration
bool Strikethrough { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the size of text area
chart.ChartTitleArea.Size = 32;
//Set the RGB color
chart.ChartTitleArea.RGBColor = System.Drawing.Color.Peru;
//Set strike through
chart.ChartTitleArea.Strikethrough = true;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Subscript
Gets or sets a value that Determines whether the text is subscript or not.The default is false.
Declaration
bool Subscript { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Superscript
Gets or sets a value that Determines whether the text is superscript or not.The default is false.
Declaration
bool Superscript { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Underline
Gets or sets the type of underline applied to the font.
Declaration
OfficeUnderline Underline { get; set; }
Property Value
Type | Description |
---|---|
OfficeUnderline |
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the bold font style
chart.ChartTitleArea.Bold = true;
//Set the color of chart title area
chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
//Set the font name
chart.ChartTitleArea.FontName = "Calibri";
//Get if the chart area is auto color
bool autoColor = chart.ChartTitleArea.IsAutoColor;
//Set the italic font style
chart.ChartTitleArea.Italic = true;
//Set the underline property
chart.ChartTitleArea.Underline = OfficeUnderline.Double;
//Set the alignment
chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
VerticalAlignment
Gets or sets a value of the font vertical alignment.
Declaration
OfficeFontVerticalAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
OfficeFontVerticalAlignment |
Examples
//Create a presentation instance
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
//Set chart data - Row1
chart.ChartData.SetValue(1, 2, "Jan");
chart.ChartData.SetValue(1, 3, "Feb");
chart.ChartData.SetValue(1, 4, "March");
//Set chart data - Row2
chart.ChartData.SetValue(2, 1, "2010");
chart.ChartData.SetValue(2, 2, "60");
chart.ChartData.SetValue(2, 3, "70");
chart.ChartData.SetValue(2, 4, "80");
//Set chart data - Row3
chart.ChartData.SetValue(3, 1, "2011");
chart.ChartData.SetValue(3, 2, "80");
chart.ChartData.SetValue(3, 3, "70");
chart.ChartData.SetValue(3, 4, "60");
//Set chart data - Row4
chart.ChartData.SetValue(4, 1, "2012");
chart.ChartData.SetValue(4, 2, "60");
chart.ChartData.SetValue(4, 3, "70");
chart.ChartData.SetValue(4, 4, "80");
//Create a new chart series with the name
IOfficeChartSerie serieJan = chart.Series.Add("Jan");
//Set the data range of chart serie � start row, start column, end row, end column
serieJan.Values = chart.ChartData[2, 2, 4, 2];
//Set the chart title
chart.ChartTitle = "This is a chart Title";
//Set the bold font style
chart.ChartTitleArea.Bold = true;
//Set the color of chart title area
chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
//Set the font name
chart.ChartTitleArea.FontName = "Calibri";
//Get if the chart area is auto color
bool autoColor = chart.ChartTitleArea.IsAutoColor;
//Set the italic font style
chart.ChartTitleArea.Italic = true;
//Set the underline property
chart.ChartTitleArea.Underline = OfficeUnderline.Double;
//Set the alignment
chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Methods
GenerateNativeFont()
Generates .Net font object corresponding to the current font.
Declaration
Font GenerateNativeFont()
Returns
Type | Description |
---|---|
Font | Generated .Net font. |