31#include <SFML/Graphics/Export.hpp>
32#include <SFML/Graphics/Glyph.hpp>
33#include <SFML/Graphics/Texture.hpp>
34#include <SFML/Graphics/Rect.hpp>
48class SFML_GRAPHICS_API
Font
182 const Glyph&
getGlyph(Uint32 codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness = 0)
const;
218 float getKerning(Uint32 first, Uint32 second,
unsigned int characterSize,
bool bold =
false)
const;
320 Row(
unsigned int rowTop,
unsigned int rowHeight) : width(0), top(rowTop), height(rowHeight) {}
330 typedef std::map<Uint64, Glyph> GlyphTable;
338 explicit Page(
bool smooth);
342 unsigned int nextRow;
343 std::vector<Row> rows;
360 Page& loadPage(
unsigned int characterSize)
const;
373 Glyph loadGlyph(Uint32 codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness)
const;
385 IntRect findGlyphRect(Page& page,
unsigned int width,
unsigned int height)
const;
395 bool setCurrentSize(
unsigned int characterSize)
const;
400 typedef std::map<unsigned int, Page> PageTable;
412 mutable PageTable m_pages;
413 mutable std::vector<Uint8> m_pixelBuffer;
414 #ifdef SFML_SYSTEM_ANDROID
Class for loading and manipulating character fonts.
float getLineSpacing(unsigned int characterSize) const
Get the line spacing.
const Glyph & getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, float outlineThickness=0) const
Retrieve a glyph of the font.
Font()
Default constructor.
const Texture & getTexture(unsigned int characterSize) const
Retrieve the texture containing the loaded glyphs of a certain size.
float getUnderlinePosition(unsigned int characterSize) const
Get the position of the underline.
Font(const Font ©)
Copy constructor.
void setSmooth(bool smooth)
Enable or disable the smooth filter.
const Info & getInfo() const
Get the font information.
bool loadFromFile(const std::string &filename)
Load the font from a file.
float getKerning(Uint32 first, Uint32 second, unsigned int characterSize, bool bold=false) const
Get the kerning offset of two glyphs.
bool loadFromStream(InputStream &stream)
Load the font from a custom stream.
bool loadFromMemory(const void *data, std::size_t sizeInBytes)
Load the font from a file in memory.
float getUnderlineThickness(unsigned int characterSize) const
Get the thickness of the underline.
bool hasGlyph(Uint32 codePoint) const
Determine if this font has a glyph representing the requested code point.
bool isSmooth() const
Tell whether the smooth filter is enabled or not.
Structure describing a glyph.
Image living on the graphics card that can be used for drawing.
Holds various information about a font.
std::string family
The font family.