OfficeTextBlockRenderer
OfficeIMO.Drawing
Renders measured text blocks through the shared dependency-free Drawing primitives.
Inheritance
- object
- OfficeTextBlockRenderer
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) #Appends SVG text elements for a measured rich text block.
Parameters
- builder System.Text.StringBuilder
- SVG markup builder.
- layout OfficeIMO.Drawing.OfficeRichTextBlockLayout
- Measured rich text block layout.
- 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.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- Vertical alignment inside the rectangle.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- Rotation center Y coordinate.
- centerLineInLineHeight bool = true
- 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) #Appends one SVG text element for a measured rich text segment.
Parameters
- builder System.Text.StringBuilder
- SVG markup builder.
- segment OfficeIMO.Drawing.OfficeRichTextSegment
- Measured rich text segment.
- x double
- Resolved segment x-coordinate.
- baseline double
- Resolved segment baseline y-coordinate.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- 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) #Appends a measured SVG text block with typed decoration and baseline styling.
Parameters
- builder System.Text.StringBuilder
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- left double
- top double
- width double
- height double
- color OfficeIMO.OfficeColor
- fontFamily string?
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment
- bold bool
- italic bool
- underline bool
- rotationDegrees double
- rotationCenterX double
- rotationCenterY double
- centerLineInLineHeight bool
- strikethrough bool
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
- baseline OfficeIMO.Drawing.OfficeTextBaseline
- decorationColor OfficeIMO.OfficeColor? = null
Returns
StringBuilderpublic 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) #Appends SVG text elements for a measured text block.
Parameters
- builder System.Text.StringBuilder
- SVG markup builder.
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- Measured text block layout.
- 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.
- color OfficeIMO.OfficeColor
- Text color.
- fontFamily string?
- SVG font-family value.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- Vertical alignment inside the rectangle.
- bold bool = false
- Whether to render bold text.
- italic bool = false
- Whether to render italic text.
- underline bool = false
- Whether to render underlined text.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- Rotation center Y coordinate.
- centerLineInLineHeight bool = true
- Whether the text glyph box should be vertically centered inside each measured line height.
- strikethrough bool = false
- 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, bool bold, bool italic, bool underline, double rotationDegrees, double rotationCenterX, double rotationCenterY, bool strikethrough) #Appends one SVG text element with optional tspan children for callers that already resolved placement.
Parameters
- builder System.Text.StringBuilder
- SVG markup builder.
- text string
- Text content. Hard breaks become tspan children.
- x double
- Resolved text anchor x-coordinate.
- y double
- Resolved first-line baseline y-coordinate.
- lineHeight double
- Distance between line baselines.
- color OfficeIMO.OfficeColor
- Text fill color.
- fontFamily string?
- SVG font-family value.
- fontSize double
- SVG font size.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment
- Horizontal alignment used to derive text-anchor.
- bold bool
- Whether to render bold text.
- italic bool
- Whether to render italic text.
- underline bool
- Whether to render underlined text.
- rotationDegrees double
- Clockwise rotation in degrees.
- rotationCenterX double
- Rotation center X coordinate.
- rotationCenterY double
- Rotation center Y coordinate.
- strikethrough bool
- 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) #Appends one SVG text element with native decoration and baseline styling.
Parameters
- builder System.Text.StringBuilder
- text string
- x double
- y double
- lineHeight double
- color OfficeIMO.OfficeColor
- fontFamily string?
- fontSize double
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- bold bool = false
- italic bool = false
- underline bool = false
- rotationDegrees double = 0
- rotationCenterX double = 0
- rotationCenterY double = 0
- strikethrough bool = false
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal
- decorationColor OfficeIMO.OfficeColor? = null
Returns
StringBuilderpublic 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) #Draws a measured rich text block on a raster canvas.
Parameters
- canvas OfficeIMO.Drawing.OfficeRasterCanvas
- Raster canvas receiving the text.
- layout OfficeIMO.Drawing.OfficeRichTextBlockLayout
- Measured rich text block layout.
- 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.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- Vertical alignment inside the rectangle.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- Rotation center Y coordinate.
- centerLineInLineHeight bool = true
- Whether each run glyph box should be vertically centered inside its measured line height.
- flipHorizontal bool = false
- Whether to mirror each rendered segment horizontally around the rotation center before rotation.
- flipVertical bool = false
- Whether to mirror each rendered segment 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, 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) #Draws a measured text block on a raster canvas.
Parameters
- canvas OfficeIMO.Drawing.OfficeRasterCanvas
- Raster canvas receiving the text.
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- Measured text block layout.
- 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.
- color OfficeIMO.OfficeColor
- Text color.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment
- Vertical alignment inside the rectangle.
- bold bool
- Whether to render bold text.
- italic bool
- Whether to render italic text.
- underline bool
- Whether to render an underline for each visible line.
- rotationDegrees double
- Clockwise rotation in degrees.
- rotationCenterX double
- Rotation center X coordinate.
- rotationCenterY double
- Rotation center Y coordinate.
- centerLineInLineHeight bool
- Whether the text glyph box should be vertically centered inside each measured line height.
- underlineOffsetFactor double
- Underline baseline offset as a factor of the resolved font size.
- strikethrough bool
- Whether to render a strikethrough for each visible line.
- fontFamily string?
- Requested font family fallback list.
- flipHorizontal bool
- Whether to mirror each rendered line horizontally around the rotation center before rotation.
- flipVertical bool
- 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) #Draws a measured text block with native decoration and baseline styling.
Parameters
- canvas OfficeIMO.Drawing.OfficeRasterCanvas
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- left double
- top double
- width double
- height double
- color OfficeIMO.OfficeColor
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- bold bool = false
- italic bool = false
- underline bool = false
- rotationDegrees double = 0
- rotationCenterX double = 0
- rotationCenterY double = 0
- centerLineInLineHeight bool = true
- underlineOffsetFactor double = 0.86
- strikethrough bool = false
- fontFamily string? = null
- flipHorizontal bool = false
- flipVertical bool = false
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal
- decorationColor OfficeIMO.OfficeColor? = null
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) #Draws a measured text-box plan on a raster canvas, including an optional text background.
Parameters
- canvas OfficeIMO.Drawing.OfficeRasterCanvas
- Raster canvas receiving the text.
- plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan
- Resolved text-box layout and placement.
- color OfficeIMO.OfficeColor
- Text color.
- bold bool
- Whether to render bold text.
- italic bool
- Whether to render italic text.
- underline bool
- Whether to render an underline for each visible line.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment?
- Horizontal alignment override. Pass null to use plan.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment?
- Vertical alignment override. Pass null to use plan.
- rotationDegrees double
- Clockwise rotation in degrees.
- rotationCenterX double
- Rotation center X coordinate.
- rotationCenterY double
- Rotation center Y coordinate.
- backgroundColor OfficeIMO.OfficeColor?
- Optional background color around the measured text block.
- backgroundPaddingX double
- Horizontal background padding.
- backgroundPaddingY double
- Vertical background padding.
- centerLineInLineHeight bool
- Whether the text glyph box should be vertically centered inside each measured line height.
- underlineOffsetFactor double
- Underline baseline offset as a factor of the resolved font size.
- strikethrough bool
- Whether to render a strikethrough for each visible line.
- fontFamily string?
- 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) #Draws a measured text-box plan with native decoration and baseline styling.
Parameters
- canvas OfficeIMO.Drawing.OfficeRasterCanvas
- plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan
- color OfficeIMO.OfficeColor
- bold bool = false
- italic bool = false
- underline bool = false
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment? = null
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment? = null
- rotationDegrees double = 0
- rotationCenterX double = 0
- rotationCenterY double = 0
- backgroundColor OfficeIMO.OfficeColor? = null
- backgroundPaddingX double = 0
- backgroundPaddingY double = 0
- centerLineInLineHeight bool = true
- underlineOffsetFactor double = 0.86
- strikethrough bool = false
- fontFamily string? = null
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal
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) #Writes an SVG text block using one text element with measured-line tspan children.
Parameters
- writer System.Xml.XmlWriter
- SVG XML writer.
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- Measured text block layout.
- 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.
- color OfficeIMO.OfficeColor
- Text color.
- fontFamily string?
- SVG font-family value.
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment
- Horizontal alignment inside the rectangle.
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment
- Vertical alignment inside the rectangle.
- bold bool
- Whether to render bold text.
- italic bool
- Whether to render italic text.
- underline bool
- Whether to render underlined text.
- rotationDegrees double
- Clockwise rotation in degrees.
- rotationCenterX double
- Rotation center X coordinate.
- rotationCenterY double
- Rotation center Y coordinate.
- svgNamespace string?
- SVG namespace URI. Pass null to write elements without a namespace.
- configureTextAttributes System.Action<System.Xml.XmlWriter>?
- Optional callback for adapter-specific attributes on the text element.
- strikethrough bool
- 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) #Writes an SVG text block with native decoration and baseline styling.
Parameters
- writer System.Xml.XmlWriter
- layout OfficeIMO.Drawing.OfficeTextBlockLayout
- left double
- top double
- width double
- height double
- color OfficeIMO.OfficeColor
- fontFamily string?
- horizontalAlignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- verticalAlignment OfficeIMO.Drawing.OfficeTextVerticalAlignment = Top
- bold bool = false
- italic bool = false
- underline bool = false
- rotationDegrees double = 0
- rotationCenterX double = 0
- rotationCenterY double = 0
- svgNamespace string? = null
- configureTextAttributes System.Action<System.Xml.XmlWriter>? = null
- strikethrough bool = false
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal
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) #Writes an SVG text-box plan with native decoration and baseline styling.
Parameters
- writer System.Xml.XmlWriter
- plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan
- color OfficeIMO.OfficeColor
- fontFamily string?
- bold bool = false
- italic bool = false
- underline bool = false
- rotationDegrees double = 0
- rotationCenterX double = 0
- rotationCenterY double = 0
- svgNamespace string? = null
- backgroundColor OfficeIMO.OfficeColor? = null
- backgroundPaddingX double = 0
- backgroundPaddingY double = 0
- configureTextAttributes System.Action<System.Xml.XmlWriter>? = null
- configureBackgroundAttributes System.Action<System.Xml.XmlWriter>? = null
- strikethrough bool = false
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal
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) #Writes a measured SVG text-box plan, including an optional text background.
Parameters
- writer System.Xml.XmlWriter
- SVG XML writer.
- plan OfficeIMO.Drawing.OfficeTextBlockRenderPlan
- Resolved text-box layout and placement.
- color OfficeIMO.OfficeColor
- Text color.
- fontFamily string?
- SVG font-family value.
- bold bool
- Whether to render bold text.
- italic bool
- Whether to render italic text.
- underline bool
- Whether to render underlined text.
- rotationDegrees double
- Clockwise rotation in degrees.
- rotationCenterX double
- Rotation center X coordinate.
- rotationCenterY double
- Rotation center Y coordinate.
- svgNamespace string?
- SVG namespace URI. Pass null to write elements without a namespace.
- backgroundColor OfficeIMO.OfficeColor?
- Optional background color around the measured text block.
- backgroundPaddingX double
- Horizontal background padding.
- backgroundPaddingY double
- Vertical background padding.
- configureTextAttributes System.Action<System.Xml.XmlWriter>?
- Optional callback for adapter-specific attributes on the text element.
- configureBackgroundAttributes System.Action<System.Xml.XmlWriter>?
- Optional callback for adapter-specific attributes on the background rect element.
- strikethrough bool
- Whether to render strikethrough text.