API Reference
OfficeTextBlockRenderPlan
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.
Returned or exposed by
- Method OfficeTextBlockRenderPlan.CreateFittedFromCenter
- Method OfficeTextBlockRenderPlan.CreateFromCenter
- Method OfficeTextBlockRenderPlan.CreateFromRectangle
- Method OfficeTextBlockRenderPlan.CreateStackedTextBlockFromRectangle
- Method OfficeTextBlockRenderPlan.CreateTextBlockFromRectangle
- Method OfficeTextBlockRenderPlan.CreateTextBlockFromRectangle
Accepted by parameters
Methods
public OfficeTextBlockBackgroundBounds CreateBackgroundBounds(Double horizontalPadding, Double verticalPadding) #OfficeTextBlockBackgroundBoundsCreates background bounds around the measured text block.
Parameters
- horizontalPadding System.Double
- verticalPadding System.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) #OfficeTextBlockRenderPlanMeasures wrapped text and creates a placement plan for a center-based rectangle.
Parameters
- text System.String
- fontSize System.Double
- centerX System.Double
- centerY System.Double
- width System.Double
- height System.Double
- measure System.Func{System.String,System.Double,System.Double}
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- lineHeightFactor System.Double = 1.2
- minimumFontSize System.Double = 5
public static OfficeTextBlockRenderPlan CreateFromCenter(OfficeTextBlockLayout layout, Double centerX, Double centerY, Double width, Double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top) #OfficeTextBlockRenderPlanCreates a placement plan for an already measured layout.
Parameters
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- centerX System.Double
- centerY System.Double
- width System.Double
- height System.Double
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
public static OfficeTextBlockRenderPlan CreateFromRectangle(OfficeTextBlockLayout layout, Double left, Double top, Double width, Double height, OfficeTextAlignment horizontalAlignment = Left, OfficeTextVerticalAlignment verticalAlignment = Top) #OfficeTextBlockRenderPlanCreates a placement plan for an already measured layout inside a left/top-based rectangle.
Parameters
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- left System.Double
- top System.Double
- width System.Double
- height System.Double
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
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) #OfficeTextBlockRenderPlanMeasures stacked text and creates a placement plan for a left/top-based rectangle.
Parameters
- text System.String
- fontSize System.Double
- left System.Double
- top System.Double
- width System.Double
- height System.Double
- measure System.Func{System.String,System.Double,System.Double}
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Center
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- lineHeightFactor System.Double = 1.2
- minimumFontSize System.Double = 5
- shrinkToFit System.Boolean = false
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) #OfficeTextBlockRenderPlanMeasures a text block and creates a placement plan for a left/top-based rectangle.
Parameters
- text System.String
- Text to lay out.
- fontSize System.Double
- Initial font size passed to measure.
- left System.Double
- Left edge of the available text rectangle.
- top System.Double
- Top edge of the available text rectangle.
- width System.Double
- Available text rectangle width.
- height System.Double
- Available text rectangle height.
- measure System.Func{System.String,System.Double,System.Double}
- Measurement delegate matching Double).
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- Vertical alignment inside the rectangle.
- lineHeightFactor System.Double = 1.2
- Multiplier used to derive line height from font size.
- minimumFontSize System.Double = 5
- Minimum font size when shrink-to-fit is enabled.
- wrap System.Boolean = false
- Whether soft wrapping is enabled.
- forceSingleLine System.Boolean = false
- Whether line breaks should be normalized to spaces and wrapping disabled.
- shrinkToFit System.Boolean = false
- 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) #OfficeTextBlockRenderPlanMeasures a text block and creates a placement plan for a left/top-based rectangle.
Parameters
- text System.String
- Text to lay out.
- fontSize System.Double
- Initial font size passed to measure.
- left System.Double
- Left edge of the available text rectangle.
- top System.Double
- Top edge of the available text rectangle.
- width System.Double
- Available text rectangle width.
- height System.Double
- Available text rectangle height.
- measure System.Func{System.String,System.Double,System.Double}
- Measurement delegate matching Double).
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment
- Vertical alignment inside the rectangle.
- lineHeightFactor System.Double
- Multiplier used to derive line height from font size.
- minimumFontSize System.Double
- Minimum font size when shrink-to-fit is enabled.
- wrap System.Boolean
- Whether soft wrapping is enabled.
- forceSingleLine System.Boolean
- Whether line breaks should be normalized to spaces and wrapping disabled.
- shrinkToFit System.Boolean
- 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.
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
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.