Velaptor.Content.Fonts.Font
Velaptor
Velaptor.Content.Fonts
Font Class
Represents a font with a set size and style that can be used to render text to the screen.
public sealed class Font :
Velaptor.Content.Fonts.IFont,
Velaptor.Content.IContent
Inheritance System.Object → Font
Properties
Atlas
Gets the font atlas texture that contains all of the bitmap data for all available glyphs for the font.
public Velaptor.Content.ITexture Atlas { get; set; }
Implements Atlas
Property Value
AvailableStylesForFamily
Gets a list of all the available font styles for the current font FamilyName.
public System.Collections.Generic.IEnumerable<Velaptor.Content.Fonts.FontStyle> AvailableStylesForFamily { get; }
Implements AvailableStylesForFamily
Property Value
System.Collections.Generic.IEnumerable<FontStyle>
CacheEnabled
Gets or sets a value indicating whether or not to cache the measurements of the text.
public bool CacheEnabled { get; set; }
Implements CacheEnabled
Property Value
FamilyName
Gets the name of the font family.
public string FamilyName { get; }
Implements FamilyName
Property Value
FilePath
Gets the path to the content.
public string FilePath { get; }
Implements FilePath
Property Value
HasKerning
Gets a value indicating whether or not the font has kerning for text rendering layout.
public bool HasKerning { get; }
Implements HasKerning
Property Value
IsDefaultFont
Gets a value indicating whether or not the font is a default font.
public bool IsDefaultFont { get; }
Implements IsDefaultFont
Property Value
LineSpacing
Gets the spacing between lines of text in pixels.
public float LineSpacing { get; set; }
Implements LineSpacing
Property Value
MaxCacheSize
Gets or sets the maximum number of measurements to cache.
public int MaxCacheSize { get; set; }
Implements MaxCacheSize
Property Value
Metrics
Gets the list of metrics for all of the glyphs supported by the font.
public System.Collections.Generic.IReadOnlyCollection<Velaptor.Graphics.GlyphMetrics> Metrics { get; }
Implements Metrics
Property Value
System.Collections.Generic.IReadOnlyCollection<GlyphMetrics>
Name
Gets the name of the content.
public string Name { get; }
Implements Name
Property Value
Size
Gets or sets the size of the font in points.
public uint Size { get; set; }
Implements Size
Property Value
Source
Gets the source of where the font was loaded.
public Velaptor.Content.Fonts.FontSource Source { get; }
Implements Source
Property Value
Style
Gets or sets the style of the font.
public Velaptor.Content.Fonts.FontStyle Style { get; set; }
Implements Style
Property Value
Methods
GetCharacterBounds(string, Vector2)
Returns the bounds of each character in the given text based on the
given textPos.
public System.Collections.Generic.IEnumerable<(char character,System.Drawing.RectangleF bounds)> GetCharacterBounds(string text, System.Numerics.Vector2 textPos);
Parameters
text
System.String
The text to get the bounds data.
textPos
System.Numerics.Vector2
The position of the text as a whole.
Implements GetCharacterBounds(string, Vector2)
Returns
System.Collections.Generic.IEnumerable<<System.Char,System.Drawing.RectangleF>>
The bounds for each character.