Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OfficeTextBlockRenderPlan

Namespace OfficeIMO.Drawing
Assembly OfficeIMO.Core
Modifiers sealed

Shared placement plan for renderers that draw a measured text block inside a center-based rectangle.

Inheritance

  • Object
  • OfficeTextBlockRenderPlan

Usage

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

Accepted by parameters

Methods

public OfficeTextBlockBackgroundBounds CreateBackgroundBounds(Double horizontalPadding, Double verticalPadding) #
Returns: OfficeTextBlockBackgroundBounds

Creates background bounds around the measured text block.

Parameters

horizontalPadding System.Double requiredposition: 0
verticalPadding System.Double requiredposition: 1
public static OfficeTextBlockRenderPlan CreateFittedFromCenter(String text, Double fontSize, Double centerX, Double centerY, Double width, Double height, Func<String, Double, Double> measure, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top, Double lineHeightFactor = 1.2, Double minimumFontSize = 5) #
Returns: OfficeTextBlockRenderPlan

Measures wrapped text and creates a placement plan for a center-based rectangle.

Parameters

text System.String requiredposition: 0
fontSize System.Double requiredposition: 1
centerX System.Double requiredposition: 2
centerY System.Double requiredposition: 3
width System.Double requiredposition: 4
height System.Double requiredposition: 5
measure System.Func{System.String,System.Double,System.Double} requiredposition: 6
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optionalposition: 7
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optionalposition: 8
lineHeightFactor System.Double = 1.2 optionalposition: 9
minimumFontSize System.Double = 5 optionalposition: 10
public static OfficeTextBlockRenderPlan CreateFromCenter(OfficeTextBlockLayout layout, Double centerX, Double centerY, Double width, Double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top) #
Returns: OfficeTextBlockRenderPlan

Creates a placement plan for an already measured layout.

Parameters

layout OfficeIMO.Drawing.OfficeTextBlockLayout requiredposition: 0
centerX System.Double requiredposition: 1
centerY System.Double requiredposition: 2
width System.Double requiredposition: 3
height System.Double requiredposition: 4
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optionalposition: 5
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optionalposition: 6
public static OfficeTextBlockRenderPlan CreateFromRectangle(OfficeTextBlockLayout layout, Double left, Double top, Double width, Double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top) #
Returns: OfficeTextBlockRenderPlan

Creates a placement plan for an already measured layout inside a left/top-based rectangle.

Parameters

layout OfficeIMO.Drawing.OfficeTextBlockLayout requiredposition: 0
left System.Double requiredposition: 1
top System.Double requiredposition: 2
width System.Double requiredposition: 3
height System.Double requiredposition: 4
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optionalposition: 5
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optionalposition: 6
public static OfficeTextBlockRenderPlan CreateStackedTextBlockFromRectangle(String text, Double fontSize, Double left, Double top, Double width, Double height, Func<String, Double, Double> measure, OfficeTextAlignment horizontalAlignment = Center, OfficeTextVerticalAlignment verticalAlignment = Top, Double lineHeightFactor = 1.2, Double minimumFontSize = 5, Boolean shrinkToFit = false) #
Returns: OfficeTextBlockRenderPlan

Measures stacked text and creates a placement plan for a left/top-based rectangle.

Parameters

text System.String requiredposition: 0
fontSize System.Double requiredposition: 1
left System.Double requiredposition: 2
top System.Double requiredposition: 3
width System.Double requiredposition: 4
height System.Double requiredposition: 5
measure System.Func{System.String,System.Double,System.Double} requiredposition: 6
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Center optionalposition: 7
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optionalposition: 8
lineHeightFactor System.Double = 1.2 optionalposition: 9
minimumFontSize System.Double = 5 optionalposition: 10
shrinkToFit System.Boolean = false optionalposition: 11
CreateTextBlockFromRectangle 2 overloads
public static OfficeTextBlockRenderPlan CreateTextBlockFromRectangle(String text, Double fontSize, Double left, Double top, Double width, Double height, Func<String, Double, Double> measure, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top, Double lineHeightFactor = 1.2, Double minimumFontSize = 5, Boolean wrap = false, Boolean forceSingleLine = false, Boolean shrinkToFit = false) #
Returns: OfficeTextBlockRenderPlan

Measures a text block and creates a placement plan for a left/top-based rectangle.

Parameters

text System.String requiredposition: 0
Text to lay out.
fontSize System.Double requiredposition: 1
Initial font size passed to measure.
left System.Double requiredposition: 2
Left edge of the available text rectangle.
top System.Double requiredposition: 3
Top edge of the available text rectangle.
width System.Double requiredposition: 4
Available text rectangle width.
height System.Double requiredposition: 5
Available text rectangle height.
measure System.Func{System.String,System.Double,System.Double} requiredposition: 6
Measurement delegate matching Double).
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optionalposition: 7
Horizontal alignment inside the rectangle.
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optionalposition: 8
Vertical alignment inside the rectangle.
lineHeightFactor System.Double = 1.2 optionalposition: 9
Multiplier used to derive line height from font size.
minimumFontSize System.Double = 5 optionalposition: 10
Minimum font size when shrink-to-fit is enabled.
wrap System.Boolean = false optionalposition: 11
Whether soft wrapping is enabled.
forceSingleLine System.Boolean = false optionalposition: 12
Whether line breaks should be normalized to spaces and wrapping disabled.
shrinkToFit System.Boolean = false optionalposition: 13
Whether single-line text should reduce font size to fit the requested width.
public static OfficeTextBlockRenderPlan CreateTextBlockFromRectangle(String text, Double fontSize, Double left, Double top, Double width, Double height, Func<String, Double, Double> measure, OfficeTextAlignment horizontalAlignment, OfficeTextVerticalAlignment verticalAlignment, Double lineHeightFactor, Double minimumFontSize, Boolean wrap, Boolean forceSingleLine, Boolean shrinkToFit, OfficeTextOverflowBehavior overflowBehavior) #
Returns: OfficeTextBlockRenderPlan

Measures a text block and creates a placement plan for a left/top-based rectangle.

Parameters

text System.String requiredposition: 0
Text to lay out.
fontSize System.Double requiredposition: 1
Initial font size passed to measure.
left System.Double requiredposition: 2
Left edge of the available text rectangle.
top System.Double requiredposition: 3
Top edge of the available text rectangle.
width System.Double requiredposition: 4
Available text rectangle width.
height System.Double requiredposition: 5
Available text rectangle height.
measure System.Func{System.String,System.Double,System.Double} requiredposition: 6
Measurement delegate matching Double).
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment requiredposition: 7
Horizontal alignment inside the rectangle.
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment requiredposition: 8
Vertical alignment inside the rectangle.
lineHeightFactor System.Double requiredposition: 9
Multiplier used to derive line height from font size.
minimumFontSize System.Double requiredposition: 10
Minimum font size when shrink-to-fit is enabled.
wrap System.Boolean requiredposition: 11
Whether soft wrapping is enabled.
forceSingleLine System.Boolean requiredposition: 12
Whether line breaks should be normalized to spaces and wrapping disabled.
shrinkToFit System.Boolean requiredposition: 13
Whether single-line text should reduce font size to fit the requested width.
overflowBehavior OfficeIMO.Drawing.OfficeTextOverflowBehavior requiredposition: 14
How overflowing text should be represented in the returned layout.

Properties

public OfficeTextBlockLayout Layout { get; } #

Measured text layout.

public Double CenterX { get; } #

Center X of the available text rectangle.

public Double CenterY { get; } #

Center Y of the available text rectangle.

public Double Left { get; } #

Left edge of the available text rectangle.

public Double Top { get; } #

Top edge of the available text rectangle.

public Double Width { get; } #

Width of the available text rectangle.

public Double Height { get; } #

Height of the available text rectangle.

public OfficeTextAlignment HorizontalAlignment { get; } #

Horizontal alignment inside the available rectangle.

public OfficeTextVerticalAlignment VerticalAlignment { get; } #

Vertical alignment inside the available rectangle.

public Double AnchorX { get; } #

Resolved X anchor used by line renderers.

public Double TextLeft { get; } #

Resolved left edge of the measured text block.

public Double TextTop { get; } #

Resolved top edge of the measured text block.