![]() |
Paradox Game Engine
v1.0.0 beta06
|
SpriteFont to use with SpriteBatch. See SpriteFont to learn how to use it. More...
Classes | |
interface | IFontManager |
struct | InternalDrawCommand |
Structure InternalDrawCommand used to pass parameters to InternalDrawGlyph | |
struct | InternalUIDrawCommand |
Structure InternalDrawCommand used to pass parameters to InternalDrawGlyph | |
struct | StringProxy |
Public Member Functions | |
virtual float | GetExtraSpacing (float fontSize) |
Get the value of the extra line spacing for the given font size. More... | |
virtual float | GetExtraLineSpacing (float fontSize) |
Get the value of the extra character spacing for the given font size. More... | |
virtual float | GetFontDefaultLineSpacing (float fontSize) |
Get the value of the font default line spacing for the given font size. More... | |
float | GetTotalLineSpacing (float fontSize) |
Gets the value of the total line spacing (font default + user defined) in pixels for a given font size. More... | |
void | PreGenerateGlyphs (string text, Vector2 size) |
Pre-generate synchronously the glyphs of the character needed to render the provided text at the provided size. More... | |
Vector2 | MeasureString (string text) |
Returns the width and height of the provided text for the current font size Size More... | |
Vector2 | MeasureString (StringBuilder text) |
Returns the width and height of the provided text for the current font size Size More... | |
Vector2 | MeasureString (string text, float fontSize) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (StringBuilder text, float fontSize) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (string text, Vector2 fontSize) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (StringBuilder text, Vector2 fontSize) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (string text, ref Vector2 fontSize) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (StringBuilder text, ref Vector2 fontSize) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (string text, Vector2 fontSize, int length) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (StringBuilder text, Vector2 fontSize, int length) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (string text, ref Vector2 fontSize, int length) |
Returns the width and height of the provided text for a given font size More... | |
Vector2 | MeasureString (StringBuilder text, ref Vector2 fontSize, int length) |
Returns the width and height of the provided text for a given font size More... | |
virtual bool | IsCharPresent (char c) |
Checks whether the provided character is present in the character map of the current SpriteFont. More... | |
![]() | |
void | Dispose () |
override string | ToString () |
Static Public Attributes | |
static readonly Logger | Logger = GlobalLogger.GetLogger("SpriteFont") |
Protected Member Functions | |
SpriteFont (FontSystem fontSystem, SpriteFontData fontData, bool isDynamic) | |
override void | Destroy () |
Disposes of object resources. More... | |
virtual float | GetBaseOffsetY (float fontSize) |
Get the value of the base offset for the given font size. More... | |
virtual Glyph | GetGlyph (char character, ref Vector2 fontSize, bool uploadGpuResources) |
Return the glyph associated to provided character at the given size. More... | |
![]() | |
ComponentBase () | |
Initializes a new instance of the ComponentBase class. More... | |
ComponentBase (string name) | |
Initializes a new instance of the ComponentBase class. More... | |
virtual void | OnNameChanged () |
Called when Name property was changed. More... | |
Protected Attributes | |
readonly FontSystem | FontSystem |
The SiliconStudio.Paradox.Graphics.Font.FontSystem that is managing this sprite font. More... | |
SwizzleMode | Swizzle |
float | BaseOffsetY |
float | DefaultLineSpacing |
readonly Dictionary< int, float > | KerningMap = new Dictionary<int, float>() |
Properties | |
IReadOnlyList< Texture2D > | Textures [get, set] |
float | Size [get, set] |
Gets the font size (resp. the default font size) for static fonts (resp. for dynamic fonts) in pixels. More... | |
char | DefaultCharacter [get, set] |
Gets or sets the default character for the font. More... | |
bool | IgnoreUnkownCharacters [get, set] |
Completely skips characters that are not in the map. More... | |
float | ExtraSpacing [get, set] |
Gets or sets extra spacing (in pixels) between the characters for the current font Size. This value is scaled during the draw in the case of dynamic fonts. Use GetExtraSpacing to get the value of the extra spacing for a given font size. More... | |
float | ExtraLineSpacing [get, set] |
Gets or sets the extra line spacing (in pixels) to add to the default font line spacing for the current font Size. This value will be scaled during the draw in the case of dynamic fonts. Use GetExtraLineSpacing to get the value of the extra spacing for a given font size. More... | |
bool | IsDynamic [get, set] |
Gets a boolean indicating if the current font is dynamic or not. More... | |
![]() | |
long | Id [get, set] |
string | Name [get, set] |
Gets or sets the name of this component. More... | |
bool | IsDisposed [get, set] |
Has the component been disposed or not yet. More... | |
![]() | |
long | Id [get] |
Gets the id of this component. More... | |
string | Name [get] |
Gets the name of this component. More... | |
![]() | |
int | ReferenceCount [get] |
Gets the reference count of this instance. More... | |
![]() | |
ObjectCollector | Collector [get] |
Gets the collector. More... | |
Additional Inherited Members | |
![]() | |
PropertyContainer | Tags |
Gets the attached properties to this component. More... | |
SpriteFont to use with SpriteBatch. See SpriteFont to learn how to use it.
Definition at line 26 of file SpriteFont.cs.
|
protected |
Definition at line 94 of file SpriteFont.cs.
|
protectedvirtual |
Disposes of object resources.
Reimplemented from SiliconStudio.Core.ComponentBase.
Definition at line 110 of file SpriteFont.cs.
|
protectedvirtual |
Get the value of the base offset for the given font size.
fontSize | The font size in pixels |
Definition at line 158 of file SpriteFont.cs.
|
virtual |
Get the value of the extra character spacing for the given font size.
fontSize | The font size in pixels |
Definition at line 138 of file SpriteFont.cs.
|
virtual |
Get the value of the extra line spacing for the given font size.
fontSize | The font size in pixels |
Definition at line 128 of file SpriteFont.cs.
|
virtual |
Get the value of the font default line spacing for the given font size.
fontSize | The font size in pixels |
Definition at line 148 of file SpriteFont.cs.
|
protectedvirtual |
Return the glyph associated to provided character at the given size.
character | The character we want the glyph of |
fontSize | The font size in pixel |
uploadGpuResources | Indicate if the GPU resource should be uploaded or not. |
Definition at line 425 of file SpriteFont.cs.
float SiliconStudio.Paradox.Graphics.SpriteFont.GetTotalLineSpacing | ( | float | fontSize | ) |
Gets the value of the total line spacing (font default + user defined) in pixels for a given font size.
Line spacing is the distance between the base lines of two consecutive lines of text (blank space as well as characters' height are thus included).
Definition at line 167 of file SpriteFont.cs.
|
virtual |
Checks whether the provided character is present in the character map of the current SpriteFont.
c | The character to check. |
Definition at line 413 of file SpriteFont.cs.
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | string | text | ) |
Returns the width and height of the provided text for the current font size Size
text | The string to measure. |
Definition at line 264 of file SpriteFont.cs.
References SiliconStudio.Core.Mathematics.Vector2.Length().
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | StringBuilder | text | ) |
Returns the width and height of the provided text for the current font size Size
text | The string to measure. |
Definition at line 274 of file SpriteFont.cs.
References SiliconStudio.Core.Mathematics.Vector2.Length().
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | string | text, |
float | fontSize | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
Definition at line 285 of file SpriteFont.cs.
References SiliconStudio.Core.Mathematics.Vector2.Length().
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | StringBuilder | text, |
float | fontSize | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
Definition at line 296 of file SpriteFont.cs.
References SiliconStudio.Core.Mathematics.Vector2.Length().
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
Definition at line 307 of file SpriteFont.cs.
References SiliconStudio.Core.Mathematics.Vector2.Length().
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | StringBuilder | text, |
Vector2 | fontSize | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
Definition at line 318 of file SpriteFont.cs.
References SiliconStudio.Core.Mathematics.Vector2.Length().
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | string | text, |
ref Vector2 | fontSize | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
Definition at line 329 of file SpriteFont.cs.
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | StringBuilder | text, |
ref Vector2 | fontSize | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
Definition at line 340 of file SpriteFont.cs.
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | string | text, |
Vector2 | fontSize, | ||
int | length | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
length | The length of the string to measure |
Definition at line 352 of file SpriteFont.cs.
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | StringBuilder | text, |
Vector2 | fontSize, | ||
int | length | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
length | The length of the string to measure |
Definition at line 364 of file SpriteFont.cs.
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | string | text, |
ref Vector2 | fontSize, | ||
int | length | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
length | The length of the string to measure |
Definition at line 376 of file SpriteFont.cs.
Vector2 SiliconStudio.Paradox.Graphics.SpriteFont.MeasureString | ( | StringBuilder | text, |
ref Vector2 | fontSize, | ||
int | length | ||
) |
Returns the width and height of the provided text for a given font size
text | The string to measure. |
fontSize | The size of the font (ignored in the case of static fonts) |
length | The length of the string to measure |
Definition at line 392 of file SpriteFont.cs.
void SiliconStudio.Paradox.Graphics.SpriteFont.PreGenerateGlyphs | ( | string | text, |
Vector2 | size | ||
) |
Pre-generate synchronously the glyphs of the character needed to render the provided text at the provided size.
text | The text containing the characters to pre-generate |
size | The size of the font |
Definition at line 189 of file SpriteFont.cs.
|
protected |
Definition at line 53 of file SpriteFont.cs.
|
protected |
Definition at line 54 of file SpriteFont.cs.
|
protected |
The SiliconStudio.Paradox.Graphics.Font.FontSystem that is managing this sprite font.
Definition at line 33 of file SpriteFont.cs.
|
protected |
Definition at line 55 of file SpriteFont.cs.
|
static |
Definition at line 51 of file SpriteFont.cs.
|
protected |
Definition at line 52 of file SpriteFont.cs.
|
getset |
Gets or sets the default character for the font.
Definition at line 67 of file SpriteFont.cs.
|
getset |
Gets or sets the extra line spacing (in pixels) to add to the default font line spacing for the current font Size. This value will be scaled during the draw in the case of dynamic fonts. Use GetExtraLineSpacing to get the value of the extra spacing for a given font size.
Line spacing is the distance between the base lines of two consecutive lines of text (blank space as well as characters' height are thus included).
Definition at line 87 of file SpriteFont.cs.
|
getset |
Gets or sets extra spacing (in pixels) between the characters for the current font Size. This value is scaled during the draw in the case of dynamic fonts. Use GetExtraSpacing to get the value of the extra spacing for a given font size.
Definition at line 79 of file SpriteFont.cs.
|
getset |
Completely skips characters that are not in the map.
Definition at line 72 of file SpriteFont.cs.
|
getset |
Gets a boolean indicating if the current font is dynamic or not.
Definition at line 92 of file SpriteFont.cs.
|
getset |
Gets the font size (resp. the default font size) for static fonts (resp. for dynamic fonts) in pixels.
Definition at line 62 of file SpriteFont.cs.
Referenced by SiliconStudio.Paradox.Graphics.SpriteBatch.MeasureString().
|
getset |
Definition at line 57 of file SpriteFont.cs.