# OfficeTextBlockRenderer

Renders measured text blocks through the shared dependency-free Drawing primitives.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeTextBlockRenderer.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.cs#L56)

**Modifiers**

static

Renders measured text blocks through the shared dependency-free Drawing primitives.

## Inheritance

- object
- OfficeTextBlockRenderer

Filter members 

Show inherited

## Methods

`public static StringBuilder AppendSvgRichTextBlock(StringBuilder builder, OfficeRichTextBlockLayout layout, double left, double top, double width, double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, bool centerLineInLineHeight = true)` [#](#member-a9ac277f12e0eba5be70f200)

[OfficeTextBlockRenderer.SvgBlocks.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.SvgBlocks.cs#L35)

Appends SVG text elements for a measured rich text block.

Parameters

**builder System.Text.StringBuilder required**

SVG markup builder.

**layout OfficeIMO.Drawing.OfficeRichTextBlockLayout required**

Measured rich text block layout.

**left double required**

Left edge of the available text rectangle.

**top double required**

Top edge of the available text rectangle.

**width double required**

Available text rectangle width.

**height double required**

Available text rectangle height.

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

Horizontal alignment inside the rectangle.

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

Vertical alignment inside the rectangle.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

**centerLineInLineHeight bool = true optional**

Whether each run glyph box should be vertically centered inside its measured line height.

Returns

`StringBuilder` The supplied builder for call chaining.

`public static StringBuilder AppendSvgRichTextSegment(StringBuilder builder, OfficeRichTextSegment segment, double x, double baseline, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0)` [#](#method-appendsvgrichtextsegment-text-stringbuilder-officeimo-drawing-officerichtextsegment-double-double-double-double-double)

[OfficeTextBlockRenderer.cs:375](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.cs#L375)

Appends one SVG text element for a measured rich text segment.

Parameters

**builder System.Text.StringBuilder required**

SVG markup builder.

**segment OfficeIMO.Drawing.OfficeRichTextSegment required**

Measured rich text segment.

**x double required**

Resolved segment x-coordinate.

**baseline double required**

Resolved segment baseline y-coordinate.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

Returns

`StringBuilder` The supplied builder for call chaining.

`public static StringBuilder AppendSvgStyledTextBlock(StringBuilder builder, OfficeTextBlockLayout layout, double left, double top, double width, double height, OfficeColor color, string? fontFamily, OfficeTextAlignment horizontalAlignment, OfficeTextVerticalAlignment verticalAlignment, bool bold, bool italic, bool underline, double rotationDegrees, double rotationCenterX, double rotationCenterY, bool centerLineInLineHeight, bool strikethrough, OfficeTextDecorationStyle underlineStyle, OfficeTextDecorationStyle strikethroughStyle, OfficeTextBaseline baseline, OfficeColor? decorationColor = null)` [#](#member-1d0f2b0cbe089a32274af66d)

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

Appends a measured SVG text block with typed decoration and baseline styling.

Parameters

**builder System.Text.StringBuilder required**

**layout OfficeIMO.Drawing.OfficeTextBlockLayout required**

**left double required**

**top double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

**fontFamily string? required**

**horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment required**

**verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment required**

**bold bool required**

**italic bool required**

**underline bool required**

**rotationDegrees double required**

**rotationCenterX double required**

**rotationCenterY double required**

**centerLineInLineHeight bool required**

**strikethrough bool required**

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required**

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required**

**baseline OfficeIMO.Drawing.OfficeTextBaseline required**

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

Returns

`StringBuilder`

`public static StringBuilder AppendSvgTextBlock(StringBuilder builder, OfficeTextBlockLayout layout, double left, double top, double width, double height, OfficeColor color, string? fontFamily, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top, bool bold = false, bool italic = false, bool underline = false, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, bool centerLineInLineHeight = true, bool strikethrough = false)` [#](#member-e984c737a1dc16dc6acc2698)

[OfficeTextBlockRenderer.SvgBlocks.cs:117](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.SvgBlocks.cs#L117)

Appends SVG text elements for a measured text block.

Parameters

**builder System.Text.StringBuilder required**

SVG markup builder.

**layout OfficeIMO.Drawing.OfficeTextBlockLayout required**

Measured text block layout.

**left double required**

Left edge of the available text rectangle.

**top double required**

Top edge of the available text rectangle.

**width double required**

Available text rectangle width.

**height double required**

Available text rectangle height.

**color OfficeIMO.OfficeColor required**

Text color.

**fontFamily string? required**

SVG font-family value.

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

Horizontal alignment inside the rectangle.

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

Vertical alignment inside the rectangle.

**bold bool = false optional**

Whether to render bold text.

**italic bool = false optional**

Whether to render italic text.

**underline bool = false optional**

Whether to render underlined text.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

**centerLineInLineHeight bool = true optional**

Whether the text glyph box should be vertically centered inside each measured line height.

**strikethrough bool = false optional**

Whether to render strikethrough text.

Returns

`StringBuilder` The supplied builder for call chaining.

AppendSvgTextElement 2 overloads

`public static StringBuilder AppendSvgTextElement(StringBuilder builder, string text, double x, double y, double lineHeight, OfficeColor color, string? fontFamily, double fontSize, OfficeTextAlignment horizontalAlignment, bool bold, bool italic, bool underline, double rotationDegrees, double rotationCenterX, double rotationCenterY, bool strikethrough)` [#](#member-f6a14a3fc89e2ff9a45764e6)

[OfficeTextBlockRenderer.SvgElements.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.SvgElements.cs#L43)

Appends one SVG text element with optional tspan children for callers that already resolved placement.

Parameters

**builder System.Text.StringBuilder required**

SVG markup builder.

**text string required**

Text content. Hard breaks become tspan children.

**x double required**

Resolved text anchor x-coordinate.

**y double required**

Resolved first-line baseline y-coordinate.

**lineHeight double required**

Distance between line baselines.

**color OfficeIMO.OfficeColor required**

Text fill color.

**fontFamily string? required**

SVG font-family value.

**fontSize double required**

SVG font size.

**horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment required**

Horizontal alignment used to derive text-anchor.

**bold bool required**

Whether to render bold text.

**italic bool required**

Whether to render italic text.

**underline bool required**

Whether to render underlined text.

**rotationDegrees double required**

Clockwise rotation in degrees.

**rotationCenterX double required**

Rotation center X coordinate.

**rotationCenterY double required**

Rotation center Y coordinate.

**strikethrough bool required**

Whether to render strikethrough text.

Returns

`StringBuilder` The supplied builder for call chaining.

`public static StringBuilder AppendSvgTextElement(StringBuilder builder, string text, double x, double y, double lineHeight, OfficeColor color, string? fontFamily, double fontSize, OfficeTextAlignment horizontalAlignment = Left, bool bold = false, bool italic = false, bool underline = false, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, bool strikethrough = false, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikethroughStyle = None, OfficeTextBaseline baseline = Normal, OfficeColor? decorationColor = null)` [#](#member-71152ae95ec2c229b5d25db9)

[OfficeTextBlockRenderer.SvgElements.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.SvgElements.cs#L72)

Appends one SVG text element with native decoration and baseline styling.

Parameters

**builder System.Text.StringBuilder required**

**text string required**

**x double required**

**y double required**

**lineHeight double required**

**color OfficeIMO.OfficeColor required**

**fontFamily string? required**

**fontSize double required**

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

**bold bool = false optional**

**italic bool = false optional**

**underline bool = false optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double = 0 optional**

**rotationCenterY double = 0 optional**

**strikethrough bool = false optional**

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal optional**

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

Returns

`StringBuilder`

`public static void DrawRasterRichTextBlock(OfficeRasterCanvas canvas, OfficeRichTextBlockLayout layout, double left, double top, double width, double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, bool centerLineInLineHeight = true, bool flipHorizontal = false, bool flipVertical = false)` [#](#member-774efba83a3696eb623ba0a3)

[OfficeTextBlockRenderer.cs:283](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.cs#L283)

Draws a measured rich text block on a raster canvas.

Parameters

**canvas OfficeIMO.Drawing.OfficeRasterCanvas required**

Raster canvas receiving the text.

**layout OfficeIMO.Drawing.OfficeRichTextBlockLayout required**

Measured rich text block layout.

**left double required**

Left edge of the available text rectangle.

**top double required**

Top edge of the available text rectangle.

**width double required**

Available text rectangle width.

**height double required**

Available text rectangle height.

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

Horizontal alignment inside the rectangle.

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

Vertical alignment inside the rectangle.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

**centerLineInLineHeight bool = true optional**

Whether each run glyph box should be vertically centered inside its measured line height.

**flipHorizontal bool = false optional**

Whether to mirror each rendered segment horizontally around the rotation center before rotation.

**flipVertical bool = false optional**

Whether to mirror each rendered segment vertically around the rotation center before rotation.

DrawRasterTextBlock 2 overloads

`public static void DrawRasterTextBlock(OfficeRasterCanvas canvas, OfficeTextBlockLayout layout, double left, double top, double width, double height, OfficeColor color, OfficeTextAlignment horizontalAlignment, OfficeTextVerticalAlignment verticalAlignment, bool bold, bool italic, bool underline, double rotationDegrees, double rotationCenterX, double rotationCenterY, bool centerLineInLineHeight, double underlineOffsetFactor, bool strikethrough, string? fontFamily, bool flipHorizontal, bool flipVertical)` [#](#member-6aac76840c319eadb9ade836)

[OfficeTextBlockRenderer.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.cs#L56)

Draws a measured text block on a raster canvas.

Parameters

**canvas OfficeIMO.Drawing.OfficeRasterCanvas required**

Raster canvas receiving the text.

**layout OfficeIMO.Drawing.OfficeTextBlockLayout required**

Measured text block layout.

**left double required**

Left edge of the available text rectangle.

**top double required**

Top edge of the available text rectangle.

**width double required**

Available text rectangle width.

**height double required**

Available text rectangle height.

**color OfficeIMO.OfficeColor required**

Text color.

**horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment required**

Horizontal alignment inside the rectangle.

**verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment required**

Vertical alignment inside the rectangle.

**bold bool required**

Whether to render bold text.

**italic bool required**

Whether to render italic text.

**underline bool required**

Whether to render an underline for each visible line.

**rotationDegrees double required**

Clockwise rotation in degrees.

**rotationCenterX double required**

Rotation center X coordinate.

**rotationCenterY double required**

Rotation center Y coordinate.

**centerLineInLineHeight bool required**

Whether the text glyph box should be vertically centered inside each measured line height.

**underlineOffsetFactor double required**

Underline baseline offset as a factor of the resolved font size.

**strikethrough bool required**

Whether to render a strikethrough for each visible line.

**fontFamily string? required**

Requested font family fallback list.

**flipHorizontal bool required**

Whether to mirror each rendered line horizontally around the rotation center before rotation.

**flipVertical bool required**

Whether to mirror each rendered line vertically around the rotation center before rotation.

`public static void DrawRasterTextBlock(OfficeRasterCanvas canvas, OfficeTextBlockLayout layout, double left, double top, double width, double height, OfficeColor color, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top, bool bold = false, bool italic = false, bool underline = false, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, bool centerLineInLineHeight = true, double underlineOffsetFactor = 0.86, bool strikethrough = false, string? fontFamily = null, bool flipHorizontal = false, bool flipVertical = false, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikethroughStyle = None, OfficeTextBaseline baseline = Normal, OfficeColor? decorationColor = null)` [#](#member-8c4366769beaf5da53863b8c)

[OfficeTextBlockRenderer.cs:91](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.cs#L91)

Draws a measured text block with native decoration and baseline styling.

Parameters

**canvas OfficeIMO.Drawing.OfficeRasterCanvas required**

**layout OfficeIMO.Drawing.OfficeTextBlockLayout required**

**left double required**

**top double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

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

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

**bold bool = false optional**

**italic bool = false optional**

**underline bool = false optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double = 0 optional**

**rotationCenterY double = 0 optional**

**centerLineInLineHeight bool = true optional**

**underlineOffsetFactor double = 0.86 optional**

**strikethrough bool = false optional**

**fontFamily string? = null optional**

**flipHorizontal bool = false optional**

**flipVertical bool = false optional**

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal optional**

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

DrawRasterTextBox 2 overloads

`public static void DrawRasterTextBox(OfficeRasterCanvas canvas, OfficeTextBlockRenderPlan plan, OfficeColor color, bool bold, bool italic, bool underline, OfficeTextAlignment? horizontalAlignment, OfficeTextVerticalAlignment? verticalAlignment, double rotationDegrees, double rotationCenterX, double rotationCenterY, OfficeColor? backgroundColor, double backgroundPaddingX, double backgroundPaddingY, bool centerLineInLineHeight, double underlineOffsetFactor, bool strikethrough, string? fontFamily)` [#](#member-7045d4dbbe4cbe0f787c35ea)

[OfficeTextBlockRenderer.cs:182](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.cs#L182)

Draws a measured text-box plan on a raster canvas, including an optional text background.

Parameters

**canvas OfficeIMO.Drawing.OfficeRasterCanvas required**

Raster canvas receiving the text.

**plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan required**

Resolved text-box layout and placement.

**color OfficeIMO.OfficeColor required**

Text color.

**bold bool required**

Whether to render bold text.

**italic bool required**

Whether to render italic text.

**underline bool required**

Whether to render an underline for each visible line.

**horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment? required**

Horizontal alignment override. Pass null to use plan.

**verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment? required**

Vertical alignment override. Pass null to use plan.

**rotationDegrees double required**

Clockwise rotation in degrees.

**rotationCenterX double required**

Rotation center X coordinate.

**rotationCenterY double required**

Rotation center Y coordinate.

**backgroundColor OfficeIMO.OfficeColor? required**

Optional background color around the measured text block.

**backgroundPaddingX double required**

Horizontal background padding.

**backgroundPaddingY double required**

Vertical background padding.

**centerLineInLineHeight bool required**

Whether the text glyph box should be vertically centered inside each measured line height.

**underlineOffsetFactor double required**

Underline baseline offset as a factor of the resolved font size.

**strikethrough bool required**

Whether to render a strikethrough for each visible line.

**fontFamily string? required**

Requested font family fallback list.

`public static void DrawRasterTextBox(OfficeRasterCanvas canvas, OfficeTextBlockRenderPlan plan, OfficeColor color, bool bold = false, bool italic = false, bool underline = false, OfficeTextAlignment? horizontalAlignment = null, OfficeTextVerticalAlignment? verticalAlignment = null, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, OfficeColor? backgroundColor = null, double backgroundPaddingX = 0, double backgroundPaddingY = 0, bool centerLineInLineHeight = true, double underlineOffsetFactor = 0.86, bool strikethrough = false, string? fontFamily = null, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikethroughStyle = None, OfficeTextBaseline baseline = Normal)` [#](#member-673939653b65e00243b4808d)

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

Draws a measured text-box plan with native decoration and baseline styling.

Parameters

**canvas OfficeIMO.Drawing.OfficeRasterCanvas required**

**plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan required**

**color OfficeIMO.OfficeColor required**

**bold bool = false optional**

**italic bool = false optional**

**underline bool = false optional**

**horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment? = null optional**

**verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment? = null optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double = 0 optional**

**rotationCenterY double = 0 optional**

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

**backgroundPaddingX double = 0 optional**

**backgroundPaddingY double = 0 optional**

**centerLineInLineHeight bool = true optional**

**underlineOffsetFactor double = 0.86 optional**

**strikethrough bool = false optional**

**fontFamily string? = null optional**

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal optional**

WriteSvgTextBlock 2 overloads

`public static void WriteSvgTextBlock(XmlWriter writer, OfficeTextBlockLayout layout, double left, double top, double width, double height, OfficeColor color, string? fontFamily, OfficeTextAlignment horizontalAlignment, OfficeTextVerticalAlignment verticalAlignment, bool bold, bool italic, bool underline, double rotationDegrees, double rotationCenterX, double rotationCenterY, string? svgNamespace, Action<XmlWriter>? configureTextAttributes, bool strikethrough)` [#](#member-b526bd0126db564a5db6b8f6)

[OfficeTextBlockRenderer.SvgWriter.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.SvgWriter.cs#L48)

Writes an SVG text block using one text element with measured-line tspan children.

Parameters

**writer System.Xml.XmlWriter required**

SVG XML writer.

**layout OfficeIMO.Drawing.OfficeTextBlockLayout required**

Measured text block layout.

**left double required**

Left edge of the available text rectangle.

**top double required**

Top edge of the available text rectangle.

**width double required**

Available text rectangle width.

**height double required**

Available text rectangle height.

**color OfficeIMO.OfficeColor required**

Text color.

**fontFamily string? required**

SVG font-family value.

**horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment required**

Horizontal alignment inside the rectangle.

**verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment required**

Vertical alignment inside the rectangle.

**bold bool required**

Whether to render bold text.

**italic bool required**

Whether to render italic text.

**underline bool required**

Whether to render underlined text.

**rotationDegrees double required**

Clockwise rotation in degrees.

**rotationCenterX double required**

Rotation center X coordinate.

**rotationCenterY double required**

Rotation center Y coordinate.

**svgNamespace string? required**

SVG namespace URI. Pass null to write elements without a namespace.

**configureTextAttributes System.Action<System.Xml.XmlWriter>? required**

Optional callback for adapter-specific attributes on the text element.

**strikethrough bool required**

Whether to render strikethrough text.

`public static void WriteSvgTextBlock(XmlWriter writer, OfficeTextBlockLayout layout, double left, double top, double width, double height, OfficeColor color, string? fontFamily, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top, bool bold = false, bool italic = false, bool underline = false, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, string? svgNamespace = null, Action<XmlWriter>? configureTextAttributes = null, bool strikethrough = false, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikethroughStyle = None, OfficeTextBaseline baseline = Normal)` [#](#member-c1003f4ee747c49dacc54c7f)

[OfficeTextBlockRenderer.SvgWriter.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.SvgWriter.cs#L80)

Writes an SVG text block with native decoration and baseline styling.

Parameters

**writer System.Xml.XmlWriter required**

**layout OfficeIMO.Drawing.OfficeTextBlockLayout required**

**left double required**

**top double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

**fontFamily string? required**

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

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

**bold bool = false optional**

**italic bool = false optional**

**underline bool = false optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double = 0 optional**

**rotationCenterY double = 0 optional**

**svgNamespace string? = null optional**

**configureTextAttributes System.Action<System.Xml.XmlWriter>? = null optional**

**strikethrough bool = false optional**

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal optional**

WriteSvgTextBox 2 overloads

`public static void WriteSvgTextBox(XmlWriter writer, OfficeTextBlockRenderPlan plan, OfficeColor color, string? fontFamily, bool bold = false, bool italic = false, bool underline = false, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, string? svgNamespace = null, OfficeColor? backgroundColor = null, double backgroundPaddingX = 0, double backgroundPaddingY = 0, Action<XmlWriter>? configureTextAttributes = null, Action<XmlWriter>? configureBackgroundAttributes = null, bool strikethrough = false, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikethroughStyle = None, OfficeTextBaseline baseline = Normal)` [#](#member-4501a3ca7d8667c9700d94b5)

[OfficeTextBlockRenderer.cs:541](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeTextBlockRenderer.cs#L541)

Writes an SVG text-box plan with native decoration and baseline styling.

Parameters

**writer System.Xml.XmlWriter required**

**plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan required**

**color OfficeIMO.OfficeColor required**

**fontFamily string? required**

**bold bool = false optional**

**italic bool = false optional**

**underline bool = false optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double = 0 optional**

**rotationCenterY double = 0 optional**

**svgNamespace string? = null optional**

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

**backgroundPaddingX double = 0 optional**

**backgroundPaddingY double = 0 optional**

**configureTextAttributes System.Action<System.Xml.XmlWriter>? = null optional**

**configureBackgroundAttributes System.Action<System.Xml.XmlWriter>? = null optional**

**strikethrough bool = false optional**

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional**

**baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal optional**

`public static void WriteSvgTextBox(XmlWriter writer, OfficeTextBlockRenderPlan plan, OfficeColor color, string? fontFamily, bool bold, bool italic, bool underline, double rotationDegrees, double rotationCenterX, double rotationCenterY, string? svgNamespace, OfficeColor? backgroundColor, double backgroundPaddingX, double backgroundPaddingY, Action<XmlWriter>? configureTextAttributes, Action<XmlWriter>? configureBackgroundAttributes, bool strikethrough)` [#](#member-4882a156e4ba1360823fa52f)

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

Writes a measured SVG text-box plan, including an optional text background.

Parameters

**writer System.Xml.XmlWriter required**

SVG XML writer.

**plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan required**

Resolved text-box layout and placement.

**color OfficeIMO.OfficeColor required**

Text color.

**fontFamily string? required**

SVG font-family value.

**bold bool required**

Whether to render bold text.

**italic bool required**

Whether to render italic text.

**underline bool required**

Whether to render underlined text.

**rotationDegrees double required**

Clockwise rotation in degrees.

**rotationCenterX double required**

Rotation center X coordinate.

**rotationCenterY double required**

Rotation center Y coordinate.

**svgNamespace string? required**

SVG namespace URI. Pass null to write elements without a namespace.

**backgroundColor OfficeIMO.OfficeColor? required**

Optional background color around the measured text block.

**backgroundPaddingX double required**

Horizontal background padding.

**backgroundPaddingY double required**

Vertical background padding.

**configureTextAttributes System.Action<System.Xml.XmlWriter>? required**

Optional callback for adapter-specific attributes on the text element.

**configureBackgroundAttributes System.Action<System.Xml.XmlWriter>? required**

Optional callback for adapter-specific attributes on the background rect element.

**strikethrough bool required**

Whether to render strikethrough text.

## 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?`

<!-- PowerForge markdown artifact sha256:97A25A6A6EA13CF82A40F82DCEED026C1BAB6884B9544F909266F96EBD43C288 -->
