Interface IFont
Represents a font which is used when drawing text.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IFont
Properties
| Improve this Doc View SourceFontFamily
Gets the font family.
Declaration
string FontFamily { get; }
Property Value
Type | Description |
---|---|
System.String | The font family. |
SizeInPoints
Gets the size of the font in points (http://www.computerhope.com/jargon/f/font-size.htm).
Declaration
float SizeInPoints { get; }
Property Value
Type | Description |
---|---|
System.Single | The size in points. |
Style
Gets the style of the font (regular, bold, italic, underline or strikeout).
Declaration
FontStyle Style { get; }
Property Value
Type | Description |
---|---|
FontStyle | The style. |
Methods
| Improve this Doc View SourceMeasureString(String, Alignment, Int32)
Measures the size that the text will take when using this font.
Declaration
SizeF MeasureString(string text, Alignment alignment, int maxWidth = 2147483647)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text. |
Alignment | alignment | The text alignment. |
System.Int32 | maxWidth | Max width if the text is expected to be wrapped, or int.MaxValue for unlimited width. |
Returns
Type | Description |
---|---|
SizeF | The size of the expected text. |
Resize(Single)
Returns a new font with the same properties as the current font, but with a new size.
Declaration
IFont Resize(float sizeInPoints)
Parameters
Type | Name | Description |
---|---|---|
System.Single | sizeInPoints | Size in points. |
Returns
Type | Description |
---|---|
IFont | The resized font. |