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
105 bool loadFromFile(
const std::string& filename);
124 bool loadFromMemory(
const void* data, std::size_t sizeInBytes);
150 const Info& getInfo()
const;
166 const Glyph& getGlyph(Uint32 codePoint,
unsigned int characterSize,
bool bold)
const;
184 float getKerning(Uint32 first, Uint32 second,
unsigned int characterSize)
const;
197 float getLineSpacing(
unsigned int characterSize)
const;
212 float getUnderlinePosition(
unsigned int characterSize)
const;
226 float getUnderlineThickness(
unsigned int characterSize)
const;
240 const Texture& getTexture(
unsigned int characterSize)
const;
250 Font& operator =(
const Font& right);
260 Row(
unsigned int rowTop,
unsigned int rowHeight) : width(0), top(rowTop), height(rowHeight) {}
270 typedef std::map<Uint32, Glyph> GlyphTable;
282 unsigned int nextRow;
283 std::vector<Row> rows;
302 Glyph loadGlyph(Uint32 codePoint,
unsigned int characterSize,
bool bold)
const;
314 IntRect findGlyphRect(Page& page,
unsigned int width,
unsigned int height)
const;
324 bool setCurrentSize(
unsigned int characterSize)
const;
329 typedef std::map<unsigned int, Page> PageTable;
339 mutable PageTable m_pages;
340 mutable std::vector<Uint8> m_pixelBuffer;
341 #ifdef SFML_SYSTEM_ANDROID
349 #endif // SFML_FONT_HPP
Class for loading and manipulating character fonts.
std::string family
The font family.
Image living on the graphics card that can be used for drawing.
Structure describing a glyph.
Holds various information about a font.