Class Font
Assembly: Ritchie.Toolbox.dll
Syntax
public abstract class Font : IDisposable
Properties
ReferenceFontSize
Gets a value indicating the reference font size, in pixels, of this font.
All global metrics, such as ascenders/descenders and underline positions,
are calculated with this font size.
Declaration
public abstract float ReferenceFontSize { get; }
Property Value
UnderlinePosition
Gets the position of underlines, relative to the top of a line of text.
Declaration
public abstract float UnderlinePosition { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
Dispose(bool)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
bool |
disposing |
|
Draw(GeometryHelper, Vector2, Color, string, int?)
Declaration
public abstract void Draw(GeometryHelper geometryHelper, Vector2 position, Color color, string text, int? fontSize = null)
Parameters
Draw(GeometryHelper, Vector2, Color, Rune, int?)
Declaration
public abstract void Draw(GeometryHelper geometryHelper, Vector2 position, Color color, Rune rune, int? fontSize = null)
Parameters
GetLineHeight(int?, bool)
Declaration
public abstract int GetLineHeight(int? fontSizePixels, bool useReferenceScale = true)
Parameters
Type |
Name |
Description |
int? |
fontSizePixels |
|
bool |
useReferenceScale |
|
Returns
Measure(string, int?, bool)
Declaration
public abstract Point Measure(string text, int? fontSize = null, bool useReferenceScale = true)
Parameters
Type |
Name |
Description |
string |
text |
|
int? |
fontSize |
|
bool |
useReferenceScale |
|
Returns
Operators
implicit operator Font(SpriteFont)
Declaration
public static implicit operator Font(SpriteFont spriteFont)
Parameters
Type |
Name |
Description |
SpriteFont |
spriteFont |
|
Returns
Implements