sf.Font Class Reference

sf.Font is the low-level class for loading and manipulating character fonts. This class is meant to be used by sf.String.
Default constructor : sf.Font().

Static methods

GetDefaultFont()
Get the SFML default built-in font (Arial).

Methods

GetCharacterSize()
Get the base size of characters in the font; All glyphs dimensions are based on this value
GetGlyph(CodePoint)
Get the description of a glyph (character) given by its unicode value. Returns glyph's visual settings, or an invalid glyph if character not found.
    CodePoint : Unicode value of the character to get.
GetImage()
Get the image containing the rendered characters (glyphs).
LoadFromFile(Filename, CharSize, UnicodeCharset) or LoadFromFile(Filename, CharSize, Charset, Encoding='utf8')
Load the font from a file. Returns True if loading was successful.
    Filename : Font file to load
    CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
    Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
LoadFromMemory(Data, CharSize, UnicodeCharset) or LoadFromMemory(Data, CharSize, Charset, Encoding='utf8')
Load the font from a file in memory. Returns True if loading was successful.
    Data : data to load
    CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
    Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)