# OfficeDrawingText

Positioned 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**

[OfficeDrawingText.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L19)

**Base**

`OfficeDrawingElement`

**Modifiers**

sealed

Positioned 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/)
- OfficeDrawingText

## 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 [OfficeDrawingText.Clone](/api/core/officeimo-drawing-officedrawingtext/#method-clone)

Filter members 

Show inherited

## Constructors

OfficeDrawingText 3 overloads

`public OfficeDrawingText(string text, double x, double y, double width, double height, OfficeFontInfo? font, OfficeColor? color, OfficeTextAlignment alignment, double? lineHeight)` [#](#constructor-ctor-string-double-double-double-double-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double)

[OfficeDrawingText.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L19)

Creates an unrotated positioned drawing text box using the original public contract.

Parameters

**text string required**

**x double required**

**y double required**

**width double required**

**height double required**

**font OfficeIMO.Drawing.OfficeFontInfo? required**

**color OfficeIMO.OfficeColor? required**

**alignment OfficeIMO.Drawing.OfficeTextAlignment required**

**lineHeight double? required**

`public OfficeDrawingText(string text, double x, double y, double width, double height, OfficeFontInfo? font = null, OfficeColor? color = null, OfficeTextAlignment alignment = Left, double? lineHeight = null, OfficeTextVerticalAlignment verticalAlignment = Top, double rotationDegrees = 0, double? rotationCenterX = null, double? rotationCenterY = null, bool wrapText = false, bool shrinkToFit = false, bool stackedText = false, bool flipHorizontal = false, bool flipVertical = false, OfficeTextPadding? padding = null, OfficeTextParagraphIndent? paragraphIndent = null)` [#](#member-880b847baddce8ee64cbc25c)

[OfficeDrawingText.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L49)

Creates a positioned drawing text box.

Parameters

**text string required**

**x double required**

**y double required**

**width double required**

**height double required**

**font OfficeIMO.Drawing.OfficeFontInfo? = null optional**

**color OfficeIMO.OfficeColor? = null optional**

**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 = false optional**

**shrinkToFit bool = false optional**

**stackedText bool = false optional**

**flipHorizontal bool = false optional**

**flipVertical bool = false optional**

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

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

`public OfficeDrawingText(string text, double x, double y, double width, double height, OfficeFontInfo? font, OfficeColor? color, OfficeTextAlignment alignment, double? lineHeight, OfficeTextVerticalAlignment verticalAlignment, double rotationDegrees, double? rotationCenterX, double? rotationCenterY, bool wrapText, bool shrinkToFit, bool stackedText, bool flipHorizontal, bool flipVertical, OfficeTextPadding? padding, OfficeTextParagraphIndent? paragraphIndent, OfficeTextDecorationStyle underlineStyle, OfficeTextDecorationStyle strikethroughStyle, OfficeTextBaseline baseline)` [#](#member-49c43d233327ff468c608e06)

[OfficeDrawingText.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L77)

Creates a positioned drawing text box with typed decoration and baseline styling.

Parameters

**text string required**

**x double required**

**y double required**

**width double required**

**height double required**

**font OfficeIMO.Drawing.OfficeFontInfo? required**

**color OfficeIMO.OfficeColor? required**

**alignment OfficeIMO.Drawing.OfficeTextAlignment required**

**lineHeight double? required**

**verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment required**

**rotationDegrees double required**

**rotationCenterX double? required**

**rotationCenterY double? required**

**wrapText bool required**

**shrinkToFit bool required**

**stackedText bool required**

**flipHorizontal bool required**

**flipVertical bool required**

**padding OfficeIMO.Drawing.OfficeTextPadding? required**

**paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent? required**

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required**

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required**

**baseline OfficeIMO.Drawing.OfficeTextBaseline required**

## Methods

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

[OfficeDrawingText.cs:294](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L294)

Creates a detached copy of this positioned text box.

Returns

`OfficeDrawingText`

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

[OfficeDrawingText.cs:291](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L291)

Creates the reusable destination-space frame transform for this text box.

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 string Text { get; private set; }` [#](#property-text)

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

Editable logical text content. PDF glyph aliases used for rendering stay internal.

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

[OfficeDrawingText.cs:186](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L186)

Text box horizontal position inside the drawing.

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

[OfficeDrawingText.cs:189](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L189)

Text box vertical position inside the drawing.

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

[OfficeDrawingText.cs:192](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L192)

Text box width.

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

[OfficeDrawingText.cs:195](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L195)

Text box height.

`public OfficeFontInfo Font { get; }` [#](#property-font)

[OfficeDrawingText.cs:198](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L198)

Font descriptor for the text.

`public OfficeColor? Color { get; }` [#](#property-color)

[OfficeDrawingText.cs:201](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L201)

Optional text color. Null lets renderers choose their default text color.

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

[OfficeDrawingText.cs:204](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L204)

Horizontal text alignment inside the text box.

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

[OfficeDrawingText.cs:207](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L207)

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

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

[OfficeDrawingText.cs:210](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L210)

Vertical placement of text inside the drawing text box.

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

[OfficeDrawingText.cs:213](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L213)

Clockwise text rotation in degrees.

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

[OfficeDrawingText.cs:216](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L216)

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

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

[OfficeDrawingText.cs:219](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L219)

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

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

[OfficeDrawingText.cs:222](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L222)

Whether renderers should wrap text to the text box width.

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

[OfficeDrawingText.cs:225](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L225)

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

`public bool StackedText { get; }` [#](#property-stackedtext)

[OfficeDrawingText.cs:228](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L228)

Whether renderers should lay text out as upright stacked characters.

`public OfficeTextDirection TextDirection { get; }` [#](#property-textdirection)

[OfficeDrawingText.cs:231](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L231)

Explicit text-flow direction, including top-to-bottom shaped text.

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

[OfficeDrawingText.cs:234](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L234)

Whether renderers should mirror the text frame horizontally around the rotation center.

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

[OfficeDrawingText.cs:237](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L237)

Whether renderers should mirror the text frame vertically around the rotation center.

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

[OfficeDrawingText.cs:240](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L240)

Insets applied inside the text frame before text layout.

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

[OfficeDrawingText.cs:243](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L243)

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

`public OfficeTextOverflowBehavior OverflowBehavior { get; }` [#](#property-overflowbehavior)

[OfficeDrawingText.cs:246](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L246)

Controls whether overflowing text is shortened or retained for caller-owned clipping.

`public double? TextAdvanceWidth { get; }` [#](#property-textadvancewidth)

[OfficeDrawingText.cs:252](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L252)

Optional resolved horizontal text advance retained by layout-aware producers. SVG and raster exporters use it to keep adjacent positioned runs aligned across font engines.

`public OfficeTextDecorationStyle UnderlineStyle { get; }` [#](#property-underlinestyle)

[OfficeDrawingText.cs:255](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L255)

Resolved underline pattern.

`public OfficeTextDecorationStyle StrikethroughStyle { get; }` [#](#property-strikethroughstyle)

[OfficeDrawingText.cs:258](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L258)

Resolved strikethrough pattern.

`public OfficeColor? DecorationColor { get; }` [#](#property-decorationcolor)

[OfficeDrawingText.cs:261](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L261)

Optional underline and strikethrough color. Null uses the text color.

`public OfficeTextBaseline Baseline { get; }` [#](#property-baseline)

[OfficeDrawingText.cs:264](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L264)

Resolved text baseline placement.

`public OfficeTextFeatureSettings FeatureSettings { get; }` [#](#property-featuresettings)

[OfficeDrawingText.cs:267](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L267)

OpenType feature selections used by text shaping.

`public string FontPalette { get; }` [#](#property-fontpalette)

[OfficeDrawingText.cs:270](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L270)

Resolved color-font palette selection.

`public int BaselineLevel { get; }` [#](#property-baselinelevel)

[OfficeDrawingText.cs:273](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L273)

Resolved cumulative superscript or subscript nesting level.

`public double BaselineScale { get; private set; }` [#](#property-baselinescale)

[OfficeDrawingText.cs:276](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L276)

Resolved cumulative script font-size scale.

`public double BaselineOffset { get; private set; }` [#](#property-baselineoffset)

[OfficeDrawingText.cs:279](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L279)

Resolved cumulative top-down baseline displacement; negative values raise text.

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

[OfficeDrawingText.cs:282](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L282)

Whether the text frame has non-zero padding.

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

[OfficeDrawingText.cs:285](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L285)

Whether the text frame has non-zero paragraph indentation.

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

[OfficeDrawingText.cs:288](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeDrawingText.cs#L288)

Whether the text frame applies rotation or mirroring.

<!-- PowerForge markdown artifact sha256:8840B11C754B3FB2350BFCBC17139B6692A93326BDF8C46F7DBA0541DA49B7B1 -->
