Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeTextBlockRenderPlan

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

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

Inheritance

  • object
  • OfficeTextBlockRenderPlan

Usage

Explore 7 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.

Accepted by parameters 2

Methods

public OfficeTextBlockBackgroundBounds CreateBackgroundBounds(double horizontalPadding, double verticalPadding) #

Creates background bounds around the measured text block.

Parameters

horizontalPadding double required
verticalPadding double required
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) #

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

Parameters

text string? required
fontSize double required
centerX double required
centerY double required
width double required
height double required
measure System.Func<string?, double, double> required
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optional
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optional
lineHeightFactor double = 1.2 optional
minimumFontSize double = 5 optional
public static OfficeTextBlockRenderPlan CreateFromCenter(OfficeTextBlockLayout layout, double centerX, double centerY, double width, double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top) #

Creates a placement plan for an already measured layout.

Parameters

layout OfficeIMO.Drawing.OfficeTextBlockLayout required
centerX double required
centerY double required
width double required
height double required
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optional
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optional
public static OfficeTextBlockRenderPlan CreateFromRectangle(OfficeTextBlockLayout layout, double left, double top, double width, double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top) #

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

Parameters

layout OfficeIMO.Drawing.OfficeTextBlockLayout required
left double required
top double required
width double required
height double required
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optional
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optional
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, bool shrinkToFit = false) #

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

Parameters

text string? required
fontSize double required
left double required
top double required
width double required
height double required
measure System.Func<string?, double, double> required
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Center optional
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optional
lineHeightFactor double = 1.2 optional
minimumFontSize double = 5 optional
shrinkToFit bool = false optional
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, bool wrap = false, bool forceSingleLine = false, bool shrinkToFit = false) #

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

Parameters

text string? required
Text to lay out.
fontSize double required
Initial font size passed to measure.
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.
measure System.Func<string?, double, double> required
Measurement delegate matching OfficeRasterCanvas.MeasureText.
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left optional
Horizontal alignment inside the rectangle.
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top optional
Vertical alignment inside the rectangle.
lineHeightFactor double = 1.2 optional
Multiplier used to derive line height from font size.
minimumFontSize double = 5 optional
Minimum font size when shrink-to-fit is enabled.
wrap bool = false optional
Whether soft wrapping is enabled.
forceSingleLine bool = false optional
Whether line breaks should be normalized to spaces and wrapping disabled.
shrinkToFit bool = false optional
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, bool wrap, bool forceSingleLine, bool shrinkToFit, OfficeTextOverflowBehavior overflowBehavior) #

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

Parameters

text string? required
Text to lay out.
fontSize double required
Initial font size passed to measure.
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.
measure System.Func<string?, double, double> required
Measurement delegate matching OfficeRasterCanvas.MeasureText.
horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment required
Horizontal alignment inside the rectangle.
verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment required
Vertical alignment inside the rectangle.
lineHeightFactor double required
Multiplier used to derive line height from font size.
minimumFontSize double required
Minimum font size when shrink-to-fit is enabled.
wrap bool required
Whether soft wrapping is enabled.
forceSingleLine bool required
Whether line breaks should be normalized to spaces and wrapping disabled.
shrinkToFit bool required
Whether single-line text should reduce font size to fit the requested width.
overflowBehavior OfficeIMO.Drawing.OfficeTextOverflowBehavior required
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.