# OfficeDrawingRichText

Positioned rich text box inside an OfficeDrawing canvas. Coordinates use the drawing's local top-left coordinate space.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeDrawingRichText.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L30)

**Base**

`OfficeDrawingElement`

**Modifiers**

sealed

Positioned rich text box inside an [OfficeDrawing](/api/core/officeimo-drawing-officedrawing/) canvas. Coordinates use the drawing's local top-left coordinate space.

## Inheritance

- [OfficeDrawingElement](/api/core/officeimo-drawing-officedrawingelement/)
- OfficeDrawingRichText

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [OfficeDrawingRichText.Clone](/api/core/officeimo-drawing-officedrawingrichtext/#method-clone)

Filter members 

Show inherited

## Constructors

`public OfficeDrawingRichText(IReadOnlyList<OfficeRichTextRun> runs, double x, double y, double width, double height, OfficeTextAlignment alignment = Left, double? lineHeight = null, OfficeTextVerticalAlignment verticalAlignment = Top, double rotationDegrees = 0, double? rotationCenterX = null, double? rotationCenterY = null, bool wrapText = true, bool shrinkToFit = false, bool flipHorizontal = false, bool flipVertical = false, OfficeTextPadding? padding = null, OfficeTextParagraphIndent? paragraphIndent = null)` [#](#member-4036317a4f6baceaac212609)

[OfficeDrawingRichText.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L30)

Creates a positioned drawing rich text box.

Parameters

**runs System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficeRichTextRun> required**

**x double required**

**y double required**

**width double required**

**height double required**

**alignment OfficeIMO.Drawing.OfficeTextAlignment = Left optional**

**lineHeight double? = null optional**

**verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double? = null optional**

**rotationCenterY double? = null optional**

**wrapText bool = true optional**

**shrinkToFit bool = false optional**

**flipHorizontal bool = false optional**

**flipVertical bool = false optional**

**padding OfficeIMO.Drawing.OfficeTextPadding? = null optional**

**paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent? = null optional**

## Methods

`public OfficeDrawingRichText Clone()` [#](#method-clone)

[OfficeDrawingRichText.cs:179](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L179)

Creates a detached copy of this positioned rich text box.

Returns

`OfficeDrawingRichText`

`public OfficeImageFrameTransform CreateFrameTransform()` [#](#method-createframetransform)

[OfficeDrawingRichText.cs:176](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L176)

Creates the reusable frame transform used by SVG and raster renderers.

Returns

`OfficeImageFrameTransform`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IReadOnlyList<OfficeRichTextRun> Runs { get; }` [#](#property-runs)

[OfficeDrawingRichText.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L93)

Styled text runs in paint order.

`public IReadOnlyList<OfficeRichTextParagraph> Paragraphs { get; }` [#](#property-paragraphs)

[OfficeDrawingRichText.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L96)

Independent paragraphs, or an empty collection for the original single-format run profile.

`public OfficeTextAreaAlignment TextAreaAlignment { get; private set; }` [#](#property-textareaalignment)

[OfficeDrawingRichText.cs:106](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L106)

Horizontal placement of the measured paragraph area inside the padded frame.

`public string PlainText { get; }` [#](#property-plaintext)

[OfficeDrawingRichText.cs:116](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L116)

Plain text formed by concatenating all runs.

`public double X { get; }` [#](#property-x)

[OfficeDrawingRichText.cs:119](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L119)

Text box horizontal position inside the drawing.

`public double Y { get; }` [#](#property-y)

[OfficeDrawingRichText.cs:122](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L122)

Text box vertical position inside the drawing.

`public double Width { get; }` [#](#property-width)

[OfficeDrawingRichText.cs:125](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L125)

Text box width.

`public double Height { get; }` [#](#property-height)

[OfficeDrawingRichText.cs:128](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L128)

Text box height.

`public OfficeTextAlignment Alignment { get; }` [#](#property-alignment)

[OfficeDrawingRichText.cs:131](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L131)

Horizontal text alignment inside the text box.

`public double? LineHeight { get; }` [#](#property-lineheight)

[OfficeDrawingRichText.cs:134](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L134)

Optional line height in drawing units. Null lets renderers use their default line height.

`public OfficeTextVerticalAlignment VerticalAlignment { get; }` [#](#property-verticalalignment)

[OfficeDrawingRichText.cs:137](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L137)

Vertical placement of text inside the drawing text box.

`public double RotationDegrees { get; }` [#](#property-rotationdegrees)

[OfficeDrawingRichText.cs:140](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L140)

Clockwise text rotation in degrees.

`public double RotationCenterX { get; }` [#](#property-rotationcenterx)

[OfficeDrawingRichText.cs:143](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L143)

X coordinate of the text rotation center in the drawing's local coordinate space.

`public double RotationCenterY { get; }` [#](#property-rotationcentery)

[OfficeDrawingRichText.cs:146](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L146)

Y coordinate of the text rotation center in the drawing's local coordinate space.

`public bool WrapText { get; }` [#](#property-wraptext)

[OfficeDrawingRichText.cs:149](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L149)

Whether renderers should wrap text to the text box width.

`public bool ShrinkToFit { get; }` [#](#property-shrinktofit)

[OfficeDrawingRichText.cs:152](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L152)

Whether renderers should reduce font sizes when text overflows the text box.

`public bool FlipHorizontal { get; }` [#](#property-fliphorizontal)

[OfficeDrawingRichText.cs:155](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L155)

Whether to mirror the rendered rich text horizontally around the frame center.

`public bool FlipVertical { get; }` [#](#property-flipvertical)

[OfficeDrawingRichText.cs:158](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L158)

Whether to mirror the rendered rich text vertically around the frame center.

`public OfficeTextPadding Padding { get; }` [#](#property-padding)

[OfficeDrawingRichText.cs:161](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L161)

Insets applied inside the text frame before rich text layout.

`public OfficeTextParagraphIndent ParagraphIndent { get; }` [#](#property-paragraphindent)

[OfficeDrawingRichText.cs:164](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L164)

First-line and continuation-line offsets applied inside the rich text frame.

`public bool HasPadding { get; }` [#](#property-haspadding)

[OfficeDrawingRichText.cs:167](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L167)

Whether the text frame has non-zero padding.

`public bool HasParagraphIndent { get; }` [#](#property-hasparagraphindent)

[OfficeDrawingRichText.cs:170](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L170)

Whether the text frame has non-zero paragraph indentation.

`public bool HasFrameTransform { get; }` [#](#property-hasframetransform)

[OfficeDrawingRichText.cs:173](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingRichText.cs#L173)

Whether the text frame applies rotation or mirroring.

<!-- PowerForge markdown artifact sha256:3EA9914D337A8B87FDBD9649DF00F28475FF04110F0489E1D88FE4710B86BDE1 -->
