21 #ifndef GF_CONSOLE_FONT_H 22 #define GF_CONSOLE_FONT_H 32 #ifndef DOXYGEN_SHOULD_SKIP_THIS 151 return m_characterSize;
169 void mapCode(
char16_t c, Vector2u position);
178 void mapCodeRange(
char16_t c,
unsigned count, Vector2u position);
269 void logFormat(
const Path& filename)
const;
282 std::vector<uint8_t> m_mapping;
285 Vector2u m_characterSize;
343 #ifndef DOXYGEN_SHOULD_SKIP_THIS void mapElement(ConsoleFontElement element)
Map an element in the font.
void mapCode(char16_t c, Vector2u position)
Map a character to a position in the font.
Vector2u getCharacterSize() const
Get the size of the characters.
Definition: ConsoleFont.h:150
bool setFormatAndComputeSizes(ConsoleFontFormat format, Vector2u size, Vector2u imageSize)
Set the format of the font.
virtual const BareTexture * getTexture() const override
Get the texture of the console font.
void mapElements(ArrayRef< ConsoleFontElement > elements)
Map some elements in the font.
void clearMapping()
Clear the mapping.
Vector2u getSize() const
Get the size of the fonts.
Definition: ConsoleFont.h:141
RectU getSubTexture(char16_t c) const
Get the sub-texture rectangle.
A bitmap console font.
Definition: ConsoleFont.h:297
char16_t character
The represented character.
Definition: ConsoleFont.h:84
bool loadFromFile(const Path &filename, ConsoleFontFormat format, Vector2u size={ 0u, 0u })
Load a console font from a file.
void logFormat(const Path &filename) const
Print the format of the font.
virtual ~ConsoleFont()
Destructor.
void mapCodeRange(char16_t c, unsigned count, Vector2u position)
Map a range of characters to consecutive positions in the font.
A texture for colored images.
Definition: Texture.h:339
RectF getTextureRect(char16_t c) const
Get the texture rectangle for a character.
A console font element.
Definition: ConsoleFont.h:83
The namespace for gf classes.
Definition: Action.h:34
An image that lives in the graphic memory that can be used for drawing.
Definition: Texture.h:67
A colored console font.
Definition: ConsoleFont.h:323
A constant reference to an array and its size.
Definition: ArrayRef.h:42
virtual const BareTexture * getTexture() const override
Get the texture of the console font.
virtual const BareTexture * getTexture() const =0
Get the texture of the console font.
A console font.
Definition: ConsoleFont.h:110
void mapString(StringRef str, Vector2u position)
Map characters from a string to consecutive positions in the font.
A constant reference to a string and its size.
Definition: StringRef.h:41
Vector2u getColorKeyPosition() const
Get the color key position.
bool loadFromFile(const Path &filename, ConsoleFontFormat format, Vector2u size={ 0u, 0u })
Load a console font from a file.
A texture with a single alpha channel.
Definition: Texture.h:474
#define GF_API
Definition: Portability.h:35
ConsoleFont()
Constructor.
ConsoleFontFormat getFormat() const
Get the format of the font.
Definition: ConsoleFont.h:132
uint8_t index
The index in the font.
Definition: ConsoleFont.h:85