public final class PortionFormat extends BasePortionFormat implements IPortionFormat
This class contains the text portion formatting properties. Unlike IPortionFormatEffectiveData, all properties of this class are writeable.
The following examples shows you how to assign the Latin font to a Paragraph's portion of PowerPoint Presentation.//Instantiate a presentation object that represents a presentation file Presentation pres = new Presentation("demo.pptx"); try { IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 10, 10, 100, 100); Paragraph paragraph = new Paragraph(); Portion portion = new Portion("Theme text format"); paragraph.getPortions().add(portion); shape.getTextFrame().getParagraphs().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.getPortionFormat().setLatinFont(new FontData("+mn-lt")); } finally { if (pres != null) pres.dispose(); }
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.
| Constructor and Description |
|---|
PortionFormat()
Initializes a new instance of
PortionFormat class. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBookmarkId()
Returns or sets bookmark identifier.
|
IPortionFormatEffectiveData |
getEffective()
Gets effective portion formatting data with the inheritance applied.
|
IHyperlink |
getHyperlinkClick()
Returns or sets the hyperlink defined for mouse click.
|
IHyperlinkManager |
getHyperlinkManager()
Hyperlinks manager.
|
IHyperlink |
getHyperlinkMouseOver()
Returns or sets the hyperlink defined for mouse over.
|
boolean |
getSmartTagClean()
Determines whether the smart tag should be cleaned.
|
void |
setBookmarkId(java.lang.String value)
Returns or sets bookmark identifier.
|
void |
setHyperlinkClick(IHyperlink value)
Returns or sets the hyperlink defined for mouse click.
|
void |
setHyperlinkMouseOver(IHyperlink value)
Returns or sets the hyperlink defined for mouse over.
|
void |
setSmartTagClean(boolean value)
Determines whether the smart tag should be cleaned.
|
getAlternativeLanguageId, getComplexScriptFont, getEastAsianFont, getEffectFormat, getEscapement, getFillFormat, getFontBold, getFontHeight, getFontItalic, getFontUnderline, getHighlightColor, getKerningMinimalSize, getKumimoji, getLanguageId, getLatinFont, getLineFormat, getNormaliseHeight, getProofDisabled, getSpacing, getStrikethroughType, getSymbolFont, getTextCapType, getUnderlineFillFormat, getUnderlineLineFormat, getVersion, isHardUnderlineFill, isHardUnderlineLine, setAlternativeLanguageId, setComplexScriptFont, setEastAsianFont, setEscapement, setFontBold, setFontHeight, setFontItalic, setFontUnderline, setHardUnderlineFill, setHardUnderlineLine, setKerningMinimalSize, setKumimoji, setLanguageId, setLatinFont, setNormaliseHeight, setProofDisabled, setSpacing, setStrikethroughType, setSymbolFont, setTextCapTypeequals, getParent_Immediate, getParent_IPresentationComponent, getParent_ISlideComponent, getPresentation, getSlide, hashCodegetClass, notify, notifyAll, toString, wait, wait, waitgetAlternativeLanguageId, getComplexScriptFont, getEastAsianFont, getEffectFormat, getEscapement, getFillFormat, getFontBold, getFontHeight, getFontItalic, getFontUnderline, getHighlightColor, getKerningMinimalSize, getKumimoji, getLanguageId, getLatinFont, getLineFormat, getNormaliseHeight, getProofDisabled, getSpacing, getStrikethroughType, getSymbolFont, getTextCapType, getUnderlineFillFormat, getUnderlineLineFormat, isHardUnderlineFill, isHardUnderlineLine, setAlternativeLanguageId, setComplexScriptFont, setEastAsianFont, setEscapement, setFontBold, setFontHeight, setFontItalic, setFontUnderline, setHardUnderlineFill, setHardUnderlineLine, setKerningMinimalSize, setKumimoji, setLanguageId, setLatinFont, setNormaliseHeight, setProofDisabled, setSpacing, setStrikethroughType, setSymbolFont, setTextCapTypepublic PortionFormat()
Initializes a new instance of PortionFormat class.
public final java.lang.String getBookmarkId()
Returns or sets bookmark identifier.
Read/write String.
getBookmarkId in interface IPortionFormatpublic final void setBookmarkId(java.lang.String value)
Returns or sets bookmark identifier.
Read/write String.
setBookmarkId in interface IPortionFormatpublic final boolean getSmartTagClean()
Determines whether the smart tag should be cleaned. No inheritance applied.
Read/write boolean.
getSmartTagClean in interface IPortionFormatpublic final void setSmartTagClean(boolean value)
Determines whether the smart tag should be cleaned. No inheritance applied.
Read/write boolean.
setSmartTagClean in interface IPortionFormatpublic final IHyperlink getHyperlinkClick()
Returns or sets the hyperlink defined for mouse click.
Read/write IHyperlink.
getHyperlinkClick in interface IHyperlinkContainerpublic final void setHyperlinkClick(IHyperlink value)
Returns or sets the hyperlink defined for mouse click.
Read/write IHyperlink.
setHyperlinkClick in interface IHyperlinkContainerpublic final IHyperlink getHyperlinkMouseOver()
Returns or sets the hyperlink defined for mouse over.
Read/write IHyperlink.
getHyperlinkMouseOver in interface IHyperlinkContainerpublic final void setHyperlinkMouseOver(IHyperlink value)
Returns or sets the hyperlink defined for mouse over.
Read/write IHyperlink.
setHyperlinkMouseOver in interface IHyperlinkContainerpublic final IHyperlinkManager getHyperlinkManager()
Hyperlinks manager.
Read-only IHyperlinkManager.
getHyperlinkManager in interface IHyperlinkContainerpublic final IPortionFormatEffectiveData getEffective()
Gets effective portion formatting data with the inheritance applied.
This example demonstrates getting some effective portion format properties.Presentation pres = new Presentation("MyPresentation.pptx"); try { IAutoShape shape = (IAutoShape)pres.getSlides().get_Item(0).getShapes().get_Item(0); IPortionFormatEffectiveData effectivePortionFormat = shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getEffective(); System.out.println("Latin font: " + effectivePortionFormat.getLatinFont().getFontName()); System.out.println("Font height: " + effectivePortionFormat.getFontHeight()); System.out.println("Fill type: " + effectivePortionFormat.getFillFormat().getFillType()); } finally { if (pres != null) pres.dispose(); }
getEffective in interface IPortionFormatIPortionFormatEffectiveData.Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.