Class Font
Defines a particular format for text, including font family name, size, and style attributes.
Implements
Inherited Members
Namespace: GameOverlay.Drawing
Assembly: GameOverlay.dll
Syntax
public class Font : IDisposable
Constructors
| Improve this Doc View SourceFont(Factory, String, Single, Boolean, Boolean, Boolean)
Initializes a new Font by using the specified name and style.
Declaration
public Font(Factory factory, string fontFamilyName, float size, bool bold = false, bool italic = false, bool wordWrapping = false)
Parameters
Type | Name | Description |
---|---|---|
SharpDX.DirectWrite.Factory | factory | The FontFactory from your Graphics device. |
String | fontFamilyName | The name of the font family. |
Single | size | The size of this Font. |
Boolean | bold | A Boolean value indicating whether this Font is bold. |
Boolean | italic | A Boolean value indicating whether this Font is italic. |
Boolean | wordWrapping | A Boolean value indicating whether this Font uses word wrapping. |
Font(TextFormat)
Initializes a new Font by using the given text format.
Declaration
public Font(TextFormat textFormat)
Parameters
Type | Name | Description |
---|---|---|
SharpDX.DirectWrite.TextFormat | textFormat |
Fields
| Improve this Doc View SourceTextFormat
A Direct2D TextFormat.
Declaration
public TextFormat TextFormat
Field Value
Type | Description |
---|---|
SharpDX.DirectWrite.TextFormat |
Properties
| Improve this Doc View SourceBold
Gets a value that indicates whether this Font is bold.
Declaration
public bool Bold { get; }
Property Value
Type | Description |
---|---|
Boolean |
FontFamilyName
Gets the name of this Fonts family
Declaration
public string FontFamilyName { get; }
Property Value
Type | Description |
---|---|
String |
FontSize
Gets the size of this Font measured in pixels.
Declaration
public float FontSize { get; }
Property Value
Type | Description |
---|---|
Single |
Italic
Gets a value that indicates whether this Font is italic.
Declaration
public bool Italic { get; }
Property Value
Type | Description |
---|---|
Boolean |
WordWeapping
Enables or disables word wrapping for this Font.
Declaration
public bool WordWeapping { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceDispose()
Releases all resources used by this Font.
Declaration
public void Dispose()
Dispose(Boolean)
Releases all resources used by this Font.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | A Boolean value indicating whether this is called from the destructor. |
Equals(Font)
Returns a value indicating whether two specified instances of Font represent the same value.
Declaration
public bool Equals(Font value)
Parameters
Type | Name | Description |
---|---|---|
Font | value | An object to compare to this instance. |
Returns
Type | Description |
---|---|
Boolean | true if |
Equals(Font, Font)
Returns a value indicating whether two specified instances of Font represent the same value.
Declaration
public static bool Equals(Font left, Font right)
Parameters
Type | Name | Description |
---|---|---|
Font | left | The first object to compare. |
Font | right | The second object to compare. |
Returns
Type | Description |
---|---|
Boolean | true if |
Equals(Object)
Returns a value indicating whether this instance and a specified Object represent the same type and value.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
Boolean | true if |
Overrides
| Improve this Doc View SourceFinalize()
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
Declaration
protected void Finalize()
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer hash code. |
Overrides
| Improve this Doc View SourceToString()
Converts this Font instance to a human-readable string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representation of this Font. |
Overrides
Operators
| Improve this Doc View SourceImplicit(Font to TextFormat)
Converts this Font to a Direct2D TextFormat.
Declaration
public static implicit operator TextFormat(Font font)
Parameters
Type | Name | Description |
---|---|---|
Font | font |
Returns
Type | Description |
---|---|
SharpDX.DirectWrite.TextFormat |