Portion — Aspose.Slides FOSS for C++ API Reference
The Portion class represents a run of text with uniform character-level formatting within a Paragraph.
Namespace: Aspose::Slides::Foss
#include <Aspose/Slides/Foss/portion.h>class PortionHeader: include/Aspose/Slides/Foss/portion.h
Constructors
| Signature | Description |
|---|---|
Portion() | Create a new empty portion. |
Properties
| Property | Accessor | Description |
|---|---|---|
text() | Read | Returns the text of this portion. |
set_text(const std::string&) | Write | Set the text content. |
IPortionFormat / PortionFormat
Character-level formatting is managed through PortionFormat. Key properties available via the IBasePortionFormat interface include access to:
FillFormat— text fillEffectFormat— text effectsLineFormat— text outlineColorFormat— text colorFontData— font settings
Usage Example
#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;
Presentation prs("deck.pptx");
// Access first shape's text frame paragraphs and portions
// auto& para = text_frame.paragraphs()[0];
// for (auto& portion : para.portions()) {
// std::cout << portion.text() << std::endl;
// }