Class OcsfmlGraphics.font

class font : [ `Copy of < rep__sf_Font : Font.t; .. >
| `File of string
| `Memory of OcsfmlSystem.raw_data_type
| `None
| `Stream of OcsfmlSystem.input_stream ] ->
object .. end

method destroy : unit
method affect : 'a. (#const_font as 'a) -> unit
method get_glyph : int -> int -> bool -> Glyph.t
Retrieve a glyph of the font.
Returns The glyph corresponding to codePoint and characterSize.
method get_kerning : int -> int -> int -> int
Get the kerning offset of two glyphs.

The kerning is an extra offset (negative) to apply between two glyphs when rendering them, to make the pair look more "natural". For example, the pair "AV" have a special kerning to make them closer than other characters. Most of the glyphs pairs have a kerning offset of zero, though.
Returns Kerning value for first and second, in pixels.

method get_line_spacing : int -> int
Get the line spacing.

Line spacing is the vertical offset to apply between two consecutive lines of text.
Returns Line spacing, in pixels

method get_texture : int -> const_texture reference
Retrieve the texture containing the loaded glyphs of a certain size.

The contents of the returned texture changes as more glyphs are requested, thus it is not very relevant. It is mainly used internally by text.
Returns Texture containing the glyphs of the requested size.

method load_from_file : string -> bool
Load the font from a file.

The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. Note that this function know nothing about the standard fonts installed on the user's system, thus you can't load them directly.
Returns True if loading succeeded, false if it failed.

method load_from_memory : OcsfmlSystem.raw_data_type -> bool
method load_from_stream : 'b. (#OcsfmlSystem.input_stream as 'b) -> bool
Load the font from a custom stream.

The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. Warning: SFML cannot preload all the font data in this function, so the contents of stream have to remain valid as long as the font is used.
Returns True if loading succeeded, false if it failed.