PortionFormat

PortionFormat class

This class contains the text portion formatting properties. Unlike IPortionFormatEffectiveData, all properties of this class are writeable.

public sealed class PortionFormat : BasePortionFormat, IPortionFormat

Constructors

NameDescription
PortionFormat()Initializes a new instance of PortionFormat class.

Properties

NameDescription
AlternativeLanguageId { get; set; }Returns or sets the Id of an alternative language. Read/write String.
AsIPresentationComponent { get; }Allows to get base IPresentationComponent interface. Read-only IPresentationComponent.
BookmarkId { get; set; }Returns or sets bookmark identifier. Read/write String.
ComplexScriptFont { get; set; }Returns or sets the complex script font info. Null means font is undefined and should be inherited from the Master. Read/write IFontData.
EastAsianFont { get; set; }Returns or sets the East Asian font info. Null means font is undefined and should be inherited from the Master. Read/write IFontData.
EffectFormat { get; }Returns the text EffectFormat properties. No inheritance applied. Read-only IEffectFormat.
Escapement { get; set; }Returns or sets the superscript or subscript text. Value from -100% (subscript) to 100% (superscript). float.NaN means value is undefined and should be inherited from the Master. Read/write Single.
FillFormat { get; }Returns the text FillFormat properties. No inheritance applied. Read-only IFillFormat.
FontBold { get; set; }Determines whether the font is bold. No inheritance applied. Read/write NullableBool.
FontHeight { get; set; }Returns or sets the font height of a portion. float.NaN means height is undefined and should be inherited from the Master. Read/write Single.
FontItalic { get; set; }Determines whether the font is itallic. No inheritance applied. Read/write NullableBool.
FontUnderline { get; set; }Returns or sets the text underline type. No inheritance applied. Read/write TextUnderlineType.
HighlightColor { get; }Returns the color used to highlight a text. No inheritance applied. Read-only IColorFormat.
HyperlinkClick { get; set; }Returns or sets the hyperlink defined for mouse click. Read/write IHyperlink.
HyperlinkManager { get; }Hyperlinks manager. Read-only IHyperlinkManager.
HyperlinkMouseOver { get; set; }Returns or sets the hyperlink defined for mouse over. Read/write IHyperlink.
IsHardUnderlineFill { get; set; }Determines whether the underline style has own FillFormat properties or inherits it from the FillFormat properties of the text. Read/write NullableBool.
IsHardUnderlineLine { get; set; }Determines whether the underline style has own LineFormat properties or inherits it from the LineFormat properties of the text. Read/write NullableBool.
KerningMinimalSize { get; set; }Returns or sets the minimal font size, for which kerning should be switched on. float.NaN means value is undefined and should be inherited from the Master. Read/write Single.
Kumimoji { get; set; }Determines whether the numbers should ignore text eastern language-specific vertical text layout. No inheritance applied. Read/write NullableBool.
LanguageId { get; set; }Returns or sets the Id of a proofing language. Used for checking spelling and grammar. Read/write String.
LatinFont { get; set; }Returns or sets the Latin font info. Null means font is undefined and should be inherited from the Master. Read/write IFontData.
LineFormat { get; }Returns the LineFormat properties for text outlining. No inheritance applied. Read-only ILineFormat.
NormaliseHeight { get; set; }Determines whether the height of a text should be normalized. No inheritance applied. Read/write NullableBool.
ProofDisabled { get; set; }Determines whether the text shouldn’t be proofed. No inheritance applied. Read/write NullableBool.
SmartTagClean { get; set; }Determines whether the smart tag should be cleaned. No inheritance applied. Read/write Boolean.
Spacing { get; set; }Returns or sets the intercharacter spacing increment. float.NaN means value is undefined and should be inherited from the Master. Read/write Single.
StrikethroughType { get; set; }Returns or sets the strikethrough type of a text. No inheritance applied. Read/write TextStrikethroughType.
SymbolFont { get; set; }Returns or sets the symbolic font info. Null means font is undefined and should be inherited from the Master. Read/write IFontData.
TextCapType { get; set; }Returns or sets the type of text capitalization. No inheritance applied. Read/write TextCapType.
UnderlineFillFormat { get; }Returns the underline line FillFormat properties. No inheritance applied. Read-only IFillFormat.
UnderlineLineFormat { get; }Returns the LineFormat properties used to outline underline line. No inheritance applied. Read-only ILineFormat.

Methods

NameDescription
override Equals(object)Compares with specified object.
GetEffective()Gets effective portion formatting data with the inheritance applied.
override GetHashCode()Returns hash code.

Remarks

This class is used to return and manipulate text portion formatting properties defined for the particular portion. This means that no inheritance is applied when getting values so for the majority of cases you will get values meaning “undefined”.

In order to get the effective formatting parameter values including inherited you need to use GetEffective method which returns a IPortionFormatEffectiveData instance.

Examples

The following examples shows you how to assign the Latin font to a Paragraph’s portion of PowerPoint Presentation.

[C#]
//Instantiate a presentation object that represents a presentation file
using (Presentation pres = new Presentation("demo.pptx"))
{
IAutoShape shape = pres.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 10, 10, 100, 100);
Paragraph paragraph = new Paragraph();
Portion portion = new Portion("Theme text format");
paragraph.Portions.Add(portion);
shape.TextFrame.Paragraphs.Add(paragraph);
// Aspose.Slides uses these special identifiers (similar to those used in PowerPoint):
// +mn-lt - Body Font Latin (Minor Latin Font)
// +mj-lt -Heading Font Latin (Major Latin Font)
// +mn-ea - Body Font East Asian (Minor East Asian Font)
// +mj-ea - Body Font East Asian (Minor East Asian Font)
portion.PortionFormat.LatinFont = new FontData("+mn-lt");
}

See Also