Class HtmlTextRenderer
Represents HTML text renderer.
Inheritance
Namespace: FastReport.Utils
Assembly: FastReport.Base.dll
Syntax
public class HtmlTextRenderer : IDisposable
Remarks
This is a more advanced version of AdvancedTextRenderer with support of more tags.
Constructors
HtmlTextRenderer(String, IGraphics, FontFamily, Single, FontStyle, Color, Color, RectangleF, Boolean, StringFormat, HorzAlign, VertAlign, ParagraphFormat, Boolean, Single, Single, InlineImageCache, Boolean, Boolean)
Initializes a new instance of HtmlTextRenderer class.
Declaration
public HtmlTextRenderer(string text, IGraphics g, FontFamily font, float size, FontStyle style, Color color, Color underlineColor, RectangleF rect, bool underlines, StringFormat format, HorzAlign horzAlign, VertAlign vertAlign, ParagraphFormat paragraphFormat, bool forceJustify, float scale, float fontScale, InlineImageCache cache, bool isPrinting = false, bool isDifferentTabPositions = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text. |
| IGraphics | g | The graphics context. |
| FontFamily | font | The font. |
| System.Single | size | The font size. |
| FontStyle | style | The font style. |
| Color | color | The text color. |
| Color | underlineColor | The underline color. |
| RectangleF | rect | The display rectangle. |
| System.Boolean | underlines | Whether to use underlines. |
| StringFormat | format | The string format. |
| HorzAlign | horzAlign | The horizontal alignment. |
| VertAlign | vertAlign | The vertical alignment. |
| ParagraphFormat | paragraphFormat | The paragraph format. |
| System.Boolean | forceJustify | Whether to force the justify alignment. |
| System.Single | scale | The scale factor. |
| System.Single | fontScale | The font scale. |
| InlineImageCache | cache | The image cache. |
| System.Boolean | isPrinting | Is printing to a printer. |
| System.Boolean | isDifferentTabPositions | Is different tab positions used. |
Fields
CultureInfo
Gets invariant culture.
Declaration
public static readonly CultureInfo CultureInfo
Field Value
| Type | Description |
|---|---|
| System.Globalization.CultureInfo |
Properties
Angle
Gets the angle of rotation.
Declaration
public int Angle { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Backgrounds
Gets a list of colored background rectangles.
Declaration
public IEnumerable<HtmlTextRenderer.RectangleFColor> Backgrounds { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<HtmlTextRenderer.RectangleFColor> |
DisplayRect
Gets a display rectangle.
Declaration
public RectangleF DisplayRect { get; }
Property Value
| Type | Description |
|---|---|
| RectangleF |
FontScale
Gets or sets font scale factor.
Declaration
public float FontScale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
HorzAlign
Gets a horizontal alignment.
Declaration
public HorzAlign HorzAlign { get; }
Property Value
| Type | Description |
|---|---|
| HorzAlign |
ParagraphFormat
Gets paragraph format object.
Declaration
public ParagraphFormat ParagraphFormat { get; }
Property Value
| Type | Description |
|---|---|
| ParagraphFormat |
Paragraphs
Gets a list of paragraphs.
Declaration
public IEnumerable<HtmlTextRenderer.Paragraph> Paragraphs { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<HtmlTextRenderer.Paragraph> |
RightToLeft
Gets RTL flag.
Declaration
public bool RightToLeft { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Scale
Gets a scale factor.
Declaration
public float Scale { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Stikeouts
Gets a list of strikeout lines.
Declaration
public IEnumerable<HtmlTextRenderer.LineFColor> Stikeouts { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<HtmlTextRenderer.LineFColor> |
TabOffset
Gets the first tab offset.
Declaration
public float TabOffset { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
TabPositions
Gets an array of tab positions.
Declaration
public float[] TabPositions { get; }
Property Value
| Type | Description |
|---|---|
| System.Single[] |
TabSize
Gets a tab size.
Declaration
public float TabSize { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Underlines
Gets a list of underline lines.
Declaration
public IEnumerable<HtmlTextRenderer.LineFColor> Underlines { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<HtmlTextRenderer.LineFColor> |
WidthRatio
Gets the width ratio of the object.
Declaration
public float WidthRatio { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
WordWrap
Gets word wrap flag.
Declaration
public bool WordWrap { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
CalcHeight()
Gets the text height.
Declaration
public float CalcHeight()
Returns
| Type | Description |
|---|---|
| System.Single | The text height. |
CalcHeight(out Int32)
Gets the text height.
Declaration
public float CalcHeight(out int charsFit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | charsFit | The number of chars fitted. |
Returns
| Type | Description |
|---|---|
| System.Single | The text height. |
CalcWidth()
Gets the text width.
Declaration
public float CalcWidth()
Returns
| Type | Description |
|---|---|
| System.Single | The text width. |
Dispose()
Disposes the object.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes the object.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | true if disposing manually. |