31 #include <SFML/Graphics/Export.hpp>
32 #include <SFML/Graphics/Glyph.hpp>
33 #include <SFML/Graphics/Texture.hpp>
34 #include <SFML/Graphics/Rect.hpp>
35 #include <SFML/System/Vector2.hpp>
36 #include <SFML/System/String.hpp>
50 class SFML_GRAPHICS_API
Font
180 const Glyph&
getGlyph(Uint32 codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness = 0)
const;
198 float getKerning(Uint32 first, Uint32 second,
unsigned int characterSize)
const;
274 Row(
unsigned int rowTop,
unsigned int rowHeight) : width(0), top(rowTop), height(rowHeight) {}
284 typedef std::map<Uint64, Glyph> GlyphTable;
296 unsigned int nextRow;
297 std::vector<Row> rows;
317 Glyph loadGlyph(Uint32 codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness)
const;
329 IntRect findGlyphRect(Page& page,
unsigned int width,
unsigned int height)
const;
339 bool setCurrentSize(
unsigned int characterSize)
const;
344 typedef std::map<unsigned int, Page> PageTable;
355 mutable PageTable m_pages;
356 mutable std::vector<Uint8> m_pixelBuffer;
357 #ifdef SFML_SYSTEM_ANDROID
365 #endif // SFML_FONT_HPP
const Info & getInfo() const
Get the font information.
float getUnderlineThickness(unsigned int characterSize) const
Get the thickness of the underline.
bool loadFromMemory(const void *data, std::size_t sizeInBytes)
Load the font from a file in memory.
Class for loading and manipulating character fonts.
float getLineSpacing(unsigned int characterSize) const
Get the line spacing.
float getKerning(Uint32 first, Uint32 second, unsigned int characterSize) const
Get the kerning offset of two glyphs.
Holds various information about a font.
Image living on the graphics card that can be used for drawing.
float getUnderlinePosition(unsigned int characterSize) const
Get the position of the underline.
const Glyph & getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, float outlineThickness=0) const
Retrieve a glyph of the font.
Font()
Default constructor.
bool loadFromFile(const std::string &filename)
Load the font from a file.
std::string family
The font family.
const Texture & getTexture(unsigned int characterSize) const
Retrieve the texture containing the loaded glyphs of a certain size.
bool loadFromStream(InputStream &stream)
Load the font from a custom stream.
Font(const Font ©)
Copy constructor.
Structure describing a glyph.