class EE::Graphics::FontBMFont¶
Overview¶
Implementation of AngelCode BMFont fonts. More…
#include <fontbmfont.hpp> class FontBMFont: public EE::Graphics::Font { public: // structs struct Page; // construction ~FontBMFont(); // methods static FontBMFont* New(const std::string fontName); static FontBMFont* New(const std::string fontName, const std::string& filename); bool loadFromFile(const std::string& filename); bool loadFromMemory(const void* data, std::size_t sizeInBytes, const std::string& imageFileBasePath); bool loadFromStream(IOStream& stream); bool loadFromPack(Pack* pack, std::string filePackPath); virtual bool isMonospace() const; virtual bool isScalable() const; virtual const Font::Info& getInfo() const; virtual const Glyph& getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, bool italic, Float outlineThickness = 0, Float maxWidth = 0) const; virtual GlyphDrawable* getGlyphDrawable(Uint32 codePoint, unsigned int characterSize, bool bold = false, bool italic = false, Float outlineThickness = 0, const Float& forzeSize = 0) const; virtual Float getKerning(Uint32 first, Uint32 second, unsigned int characterSize, bool bold, bool italic, Float outlineThickness = 0) const; virtual Float getLineSpacing(unsigned int characterSize) const; virtual Uint32 getFontHeight(const Uint32& characterSize) const; virtual Float getUnderlinePosition(unsigned int characterSize) const; virtual Float getUnderlineThickness(unsigned int characterSize) const; virtual Texture* getTexture(unsigned int characterSize) const; virtual bool loaded() const; FontBMFont& operator=(const FontBMFont& right); };
Inherited Members¶
public: // typedefs typedef std::function<void(Uint32, Event, Font*)> FontEventCallback; // enums enum Event; // structs struct Info; // methods static Uint32 getHorizontalAlign(const Uint32& flags); static Uint32 getVerticalAlign(const Uint32& flags); static bool isEmojiCodePoint(const Uint32& codePoint); static bool containsEmojiCodePoint(const String& string); static std::vector<std::size_t> emojiCodePointsPositions(const String& string); virtual Uint32 getFontHeight(const Uint32& characterSize) const = 0; const FontType& getType() const; const std::string& getName() const; void setName(const std::string& setName); const String::HashType& getId(); virtual bool isMonospace() const = 0; virtual bool isScalable() const = 0; virtual const Info& getInfo() const = 0; virtual const Glyph& getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, bool italic, Float outlineThickness = 0, Float maxWidth = 0) const = 0; virtual GlyphDrawable* getGlyphDrawable(Uint32 codePoint, unsigned int characterSize, bool bold = false, bool italic = false, Float outlineThickness = 0, const Float& forzeSize = 0) const = 0; virtual Float getKerning(Uint32 first, Uint32 second, unsigned int characterSize, bool bold, bool italic, Float outlineThickness = 0) const = 0; virtual Float getAscent(unsigned int characterSize) const; virtual Float getDescent(unsigned int) const; virtual Float getLineSpacing(unsigned int characterSize) const = 0; virtual Float getUnderlinePosition(unsigned int characterSize) const = 0; virtual Float getUnderlineThickness(unsigned int characterSize) const = 0; virtual Texture* getTexture(unsigned int characterSize) const = 0; virtual Uint32 getFontStyle() const; virtual bool isRegular() const; virtual bool isBold() const; virtual bool isItalic() const; virtual bool isBoldItalic() const; virtual bool hasBold() const; virtual bool hasItalic() const; virtual bool hasBoldItalic() const; virtual bool loaded() const = 0; Uint32 pushFontEventCallback(const FontEventCallback& cb); void popFontEventCallback(const Uint32& callbackId);
Detailed Documentation¶
Implementation of AngelCode BMFont fonts.
Methods¶
virtual GlyphDrawable* getGlyphDrawable(Uint32 codePoint, unsigned int characterSize, bool bold = false, bool italic = false, Float outlineThickness = 0, const Float& forzeSize = 0) const
Returns:
The glyph drawable that represents the glyph in a texture. The glyph drawable allocation is managed by the font.
virtual Uint32 getFontHeight(const Uint32& characterSize) const
Returns:
The current font height