21#ifndef GF_CONSOLE_FONT_H
22#define GF_CONSOLE_FONT_H
26#include "GraphicsApi.h"
33#ifndef DOXYGEN_SHOULD_SKIP_THIS
161 return m_characterSize;
280 std::vector<uint8_t> m_mapping;
355#ifndef DOXYGEN_SHOULD_SKIP_THIS
A texture with a single alpha channel.
Definition: Texture.h:427
An image that lives in the graphic memory that can be used for drawing.
Definition: Texture.h:79
A bitmap console font.
Definition: ConsoleFont.h:295
BitmapConsoleFont(const Path &filename, ConsoleFontFormat format, Vector2i size={ 0u, 0u })
Load a console font from a file.
const BareTexture * getTexture() const override
Get the texture of the console font.
BitmapConsoleFont(const Image &image, ConsoleFontFormat format, Vector2i size={ 0u, 0u })
Load a console font from an image.
A colored console font.
Definition: ConsoleFont.h:328
ColoredConsoleFont(const Path &filename, ConsoleFontFormat format, Vector2i size={ 0u, 0u })
Load a console font from a file.
ColoredConsoleFont(const Image &image, ConsoleFontFormat format, Vector2i size={ 0u, 0u })
Load a console font from an image.
const BareTexture * getTexture() const override
Get the texture of the console font.
A console font.
Definition: ConsoleFont.h:111
void mapElement(ConsoleFontElement element)
Map an element in the font.
ConsoleFontFormat getFormat() const
Get the format of the font.
Definition: ConsoleFont.h:142
void clearMapping()
Clear the mapping.
void mapCodeRange(char16_t c, int count, Vector2i position)
Map a range of characters to consecutive positions in the font.
void logFormat(const Path &filename) const
Print the format of the font.
Vector2i getColorKeyPosition() const
Get the color key position.
Vector2i getCharacterSize() const
Get the size of the characters.
Definition: ConsoleFont.h:160
ConsoleFont(const Image &image, ConsoleFontFormat format, Vector2i size)
Constructor.
void mapElements(Span< const ConsoleFontElement > elements)
Map some elements in the font.
void mapString(std::string_view str, Vector2i position)
Map characters from a string to consecutive positions in the font.
RectI getSubTexture(char16_t c) const
Get the sub-texture rectangle.
RectF getTextureRect(char16_t c) const
Get the texture rectangle for a character.
virtual const BareTexture * getTexture() const =0
Get the texture of the console font.
virtual ~ConsoleFont()
Destructor.
void mapCode(char16_t c, Vector2i position)
Map a character to a position in the font.
Vector2i getSize() const
Get the size of the fonts.
Definition: ConsoleFont.h:151
ConsoleFont()
Constructor.
Class for loading, manipulating and saving images.
Definition: Image.h:81
A span.
Definition: Span.h:414
A texture for colored images.
Definition: Texture.h:313
std::filesystem::path Path
A path in the filesystem.
Definition: Path.h:40
The namespace for gf classes.
A console font element.
Definition: ConsoleFont.h:84
uint8_t index
The index in the font.
Definition: ConsoleFont.h:86
char16_t character
The represented character.
Definition: ConsoleFont.h:85