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 Portion

Header: include/Aspose/Slides/Foss/portion.h


Constructors

SignatureDescription
Portion()Create a new empty portion.

Properties

PropertyAccessorDescription
text()ReadReturns the text of this portion.
set_text(const std::string&)WriteSet the text content.

IPortionFormat / PortionFormat

Character-level formatting is managed through PortionFormat. Key properties available via the IBasePortionFormat interface include access to:

  • FillFormat — text fill
  • EffectFormat — text effects
  • LineFormat — text outline
  • ColorFormat — text color
  • FontData — 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;
// }

See Also