RichText
Overview
RichText is a class in Aspose.Note FOSS for Python.
Inherits from: Node.
RichText.Append appends the given text with optional style to the end of the rich text.
This class provides 12 methods for working with RichText objects in Python programs.
Available methods include: Append, AppendFront, Clear, GetEnumerator, IndexOf, Insert, Remove, Replace, Trim, TrimEnd, TrimStart, __init__.
All exported members are accessible to any Python application after installing the Aspose.Note FOSS for Python package.
Properties: Alignment, IsTitleDate, IsTitleText, IsTitleTime, LastModifiedTime, Length, and 7 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Text | str | Read | Gets the text. |
TextRuns | list[TextRun] | Read | Gets the text runs. |
ParagraphStyle | ParagraphStyle | Read | Gets the paragraph style. |
Tags | list[NoteTag] | Read | Gets the tags. |
Length | int | Read | Gets the length. |
Alignment | HorizontalAlignment | None | Read | Gets the alignment. |
IsTitleText | bool | Read | Gets the is title text. |
IsTitleDate | bool | Read | Gets the is title date. |
IsTitleTime | bool | Read | Gets the is title time. |
LastModifiedTime | `` | Read | Gets the last modified time. |
SpaceBefore | `` | Read | Gets the space before. |
SpaceAfter | `` | Read | Gets the space after. |
LineSpacing | `` | Read | Gets the line spacing. |
Methods
| Signature | Description |
|---|---|
__init__(Text: str, TextRuns: list[TextRun] | None, ParagraphStyle: ParagraphStyle | None, Alignment: HorizontalAlignment | None, Tags: list[NoteTag] | None, LastModifiedTime: datetime | None, SpaceBefore: float | None, SpaceAfter: float | None, LineSpacing: float | None) | |
Append(text: str, style: TextStyle | None) → RichText | Adds the given text with an optional style to the end and returns the RichText |
AppendFront(text: str, style: TextStyle | None) → RichText | Inserts the given text with an optional style at the beginning and returns the RichText |
Clear() → RichText | Removes all content from the rich text and returns the instance |
GetEnumerator() → Iterator[str] | Returns an iterator over the string segments of the RichText |
IndexOf(value: str, startIndex: int, count: int | None, comparison: str | None) → int | Returns the index of value within the text, searching from startIndex for count characters with optional comparison |
Insert(index: int, text: str, style: TextStyle | None) → RichText | Places the given text with an optional style at the specified index and returns the RichText |
Remove(start: int, count: int | None) → RichText | Deletes a segment starting at the given index for an optional count and returns the RichText |
Replace(old_value: str, new_value: str, style: TextStyle | None) → RichText | Replaces occurrences of old_value with new_value and applies optional style to the new text |
Trim() → RichText | Removes leading and trailing whitespace from the rich text |
TrimStart() → RichText | Removes leading whitespace from the rich text |
TrimEnd() → RichText | Removes trailing whitespace from the rich text |