Class DrawUtils
Contains properties and method related to draw operations.
Inheritance
Namespace: FastReport.Utils
Assembly: FastReport.Base.dll
Syntax
public static class DrawUtils
Properties
DefaultFont
Gets or sets default font used in FR UI.
Declaration
public static Font DefaultFont { get; set; }
Property Value
| Type | Description |
|---|---|
| Font |
Remarks
FR UI is optimized for "Tahoma 8.25pt" metrics. If you use larger font, set UIScale property to scale forms.
DefaultReportFont
Gets default report font (locale specific).
Declaration
public static Font DefaultReportFont { get; }
Property Value
| Type | Description |
|---|---|
| Font |
Remarks
On most locales this is Arial,10. ja,zh locales use different fonts (MS UI Gothic,9 and SimSun,9).
DefaultTextObjectFont
Gets the default text object's font (Arial, 10).
Declaration
public static Font DefaultTextObjectFont { get; }
Property Value
| Type | Description |
|---|---|
| Font |
FixedFont
Gets default fixed font.
Declaration
public static Font FixedFont { get; }
Property Value
| Type | Description |
|---|---|
| Font |
ScreenDpi
Gets the primary screen dpi.
Declaration
public static int ScreenDpi { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
ScreenDpiFX
Gets the primary screen dpi ratio (96 / ScreenDpi).
Declaration
public static float ScreenDpiFX { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
UIScale
Gets or sets a value that determines additional scale factor applied to FR forms. Used if you change the DefaultFont property.
Declaration
public static float UIScale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Methods
MeasureString(Graphics, String, Font, RectangleF, StringFormat)
Measures a text.
Declaration
public static SizeF MeasureString(Graphics g, string text, Font font, RectangleF layoutRect, StringFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| Graphics | g | The graphics context. |
| System.String | text | The text to measure. |
| Font | font | The font. |
| RectangleF | layoutRect | The layout rect. |
| StringFormat | format | The string format. |
Returns
| Type | Description |
|---|---|
| SizeF | The size of text. |
MeasureString(Graphics, String, Font, StringFormat)
Measures a text.
Declaration
public static SizeF MeasureString(Graphics g, string text, Font font, StringFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| Graphics | g | The graphics context. |
| System.String | text | The text to measure. |
| Font | font | The font. |
| StringFormat | format | The string format. |
Returns
| Type | Description |
|---|---|
| SizeF | The size of text. |
MeasureString(String)
Measures a text.
Declaration
public static SizeF MeasureString(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text to measure. |
Returns
| Type | Description |
|---|---|
| SizeF | The size of text. |
MeasureString(String, Font)
Measures a text.
Declaration
public static SizeF MeasureString(string text, Font font)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text to measure. |
| Font | font | The font. |
Returns
| Type | Description |
|---|---|
| SizeF | The size of text. |