OfficeTextBlockRenderPlan
OfficeIMO.Drawing
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.
Returned or exposed by 5
Accepted by parameters 2
Methods
public OfficeTextBlockBackgroundBounds CreateBackgroundBounds(double horizontalPadding, double verticalPadding) #Creates background bounds around the measured text block.
Parameters
- horizontalPadding double
- verticalPadding double
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?
- fontSize double
- centerX double
- centerY double
- width double
- height double
- measure System.Func<string?, double, double>
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- lineHeightFactor double = 1.2
- minimumFontSize double = 5
Returns
OfficeTextBlockRenderPlanpublic 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
- centerX double
- centerY double
- width double
- height double
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
Returns
OfficeTextBlockRenderPlanpublic 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
- left double
- top double
- width double
- height double
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
Returns
OfficeTextBlockRenderPlanpublic 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?
- fontSize double
- left double
- top double
- width double
- height double
- measure System.Func<string?, double, double>
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Center
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- lineHeightFactor double = 1.2
- minimumFontSize double = 5
- shrinkToFit bool = false
Returns
OfficeTextBlockRenderPlanpublic 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?
- Text to lay out.
- fontSize double
- Initial font size passed to measure.
- left double
- Left edge of the available text rectangle.
- top double
- Top edge of the available text rectangle.
- width double
- Available text rectangle width.
- height double
- Available text rectangle height.
- measure System.Func<string?, double, double>
- Measurement delegate matching OfficeRasterCanvas.MeasureText.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- Vertical alignment inside the rectangle.
- lineHeightFactor double = 1.2
- Multiplier used to derive line height from font size.
- minimumFontSize double = 5
- Minimum font size when shrink-to-fit is enabled.
- wrap bool = false
- Whether soft wrapping is enabled.
- forceSingleLine bool = false
- Whether line breaks should be normalized to spaces and wrapping disabled.
- shrinkToFit bool = false
- Whether single-line text should reduce font size to fit the requested width.
Returns
OfficeTextBlockRenderPlanpublic 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?
- Text to lay out.
- fontSize double
- Initial font size passed to measure.
- left double
- Left edge of the available text rectangle.
- top double
- Top edge of the available text rectangle.
- width double
- Available text rectangle width.
- height double
- Available text rectangle height.
- measure System.Func<string?, double, double>
- Measurement delegate matching OfficeRasterCanvas.MeasureText.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment
- Vertical alignment inside the rectangle.
- lineHeightFactor double
- Multiplier used to derive line height from font size.
- minimumFontSize double
- Minimum font size when shrink-to-fit is enabled.
- wrap bool
- Whether soft wrapping is enabled.
- forceSingleLine bool
- Whether line breaks should be normalized to spaces and wrapping disabled.
- shrinkToFit bool
- Whether single-line text should reduce font size to fit the requested width.
- overflowBehavior OfficeIMO.Drawing.OfficeTextOverflowBehavior
- How overflowing text should be represented in the returned layout.
Returns
OfficeTextBlockRenderPlanInherited Methods
Properties
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 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.