C# Class SFML.Graphics.Font

Font is the low-level class for loading and manipulating character fonts. This class is meant to be used by String2D
Inheritance: ObjectBase
Exibir arquivo Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
Font ( Font copy ) : System

Construct the font from another font

Font ( Stream stream ) : System

Construct the font from a custom stream

Font ( byte bytes ) : System

Construct the font from a file in memory

Font ( string filename ) : System

Construct the font from a file

GetGlyph ( uint codePoint, uint characterSize, bool bold, float outlineThickness ) : Glyph

Get a glyph in the font

GetInfo ( ) : Info

Get the font information

GetKerning ( uint first, uint second, uint characterSize ) : float

Get the kerning offset between two glyphs

GetLineSpacing ( uint characterSize ) : float

Get spacing between two consecutive lines

GetTexture ( uint characterSize ) : Texture

Get the texture containing the glyphs of a given size

GetUnderlinePosition ( uint characterSize ) : float

Get the position of the underline

GetUnderlineThickness ( uint characterSize ) : float

Get the thickness of the underline

ToString ( ) : string

Provide a string describing the object

Protected Methods

Method Description
Destroy ( bool disposing ) : void

Handle the destruction of the object

Private Methods

Method Description
Font ( IntPtr cPointer ) : System

Internal constructor

sfFont_copy ( IntPtr Font ) : IntPtr
sfFont_createFromFile ( string Filename ) : IntPtr
sfFont_createFromMemory ( IntPtr data, ulong size ) : IntPtr
sfFont_createFromStream ( IntPtr stream ) : IntPtr
sfFont_destroy ( IntPtr CPointer ) : void
sfFont_getGlyph ( IntPtr CPointer, uint codePoint, uint characterSize, bool bold, float outlineThickness ) : Glyph
sfFont_getInfo ( IntPtr CPointer ) : InfoMarshalData
sfFont_getKerning ( IntPtr CPointer, uint first, uint second, uint characterSize ) : float
sfFont_getLineSpacing ( IntPtr CPointer, uint characterSize ) : float
sfFont_getTexture ( IntPtr CPointer, uint characterSize ) : IntPtr
sfFont_getUnderlinePosition ( IntPtr CPointer, uint characterSize ) : float
sfFont_getUnderlineThickness ( IntPtr CPointer, uint characterSize ) : float

Method Details

Destroy() protected method

Handle the destruction of the object
protected Destroy ( bool disposing ) : void
disposing bool Is the GC disposing the object, or is it an explicit call?
return void

Font() public method

Construct the font from another font
public Font ( Font copy ) : System
copy Font Font to copy
return System

Font() public method

Construct the font from a custom stream
public Font ( Stream stream ) : System
stream Stream Source stream to read from
return System

Font() public method

Construct the font from a file in memory
public Font ( byte bytes ) : System
bytes byte Byte array containing the file contents
return System

Font() public method

Construct the font from a file
public Font ( string filename ) : System
filename string Font file to load
return System

GetGlyph() public method

Get a glyph in the font
public GetGlyph ( uint codePoint, uint characterSize, bool bold, float outlineThickness ) : Glyph
codePoint uint Unicode code point of the character to get
characterSize uint Character size
bold bool Retrieve the bold version or the regular one?
outlineThickness float Thickness of outline (when != 0 the glyph will not be filled)
return Glyph

GetInfo() public method

Get the font information
public GetInfo ( ) : Info
return Info

GetKerning() public method

Get the kerning offset between two glyphs
public GetKerning ( uint first, uint second, uint characterSize ) : float
first uint Unicode code point of the first character
second uint Unicode code point of the second character
characterSize uint Character size
return float

GetLineSpacing() public method

Get spacing between two consecutive lines
public GetLineSpacing ( uint characterSize ) : float
characterSize uint Character size
return float

GetTexture() public method

Get the texture containing the glyphs of a given size
public GetTexture ( uint characterSize ) : Texture
characterSize uint Character size
return Texture

GetUnderlinePosition() public method

Get the position of the underline
public GetUnderlinePosition ( uint characterSize ) : float
characterSize uint Character size
return float

GetUnderlineThickness() public method

Get the thickness of the underline
public GetUnderlineThickness ( uint characterSize ) : float
characterSize uint Character size
return float

ToString() public method

Provide a string describing the object
public ToString ( ) : string
return string