A console font.
More...
#include <gf/ConsoleFont.h>
◆ ConsoleFont() [1/2]
gf::ConsoleFont::ConsoleFont |
( |
| ) |
|
Constructor.
No font is loaded.
◆ ConsoleFont() [2/2]
Constructor.
- Parameters
-
image | The image used by the font |
format | The format of the font |
size | The size given by the user, may be \( (0, 0) \) |
◆ ~ConsoleFont()
virtual gf::ConsoleFont::~ConsoleFont |
( |
| ) |
|
|
virtual |
◆ clearMapping()
void gf::ConsoleFont::clearMapping |
( |
| ) |
|
Clear the mapping.
All characters are mapped to the first position in the font.
◆ getCharacterSize()
Vector2i gf::ConsoleFont::getCharacterSize |
( |
| ) |
const |
|
inline |
Get the size of the characters.
- Returns
- The size in pixels of the characters
◆ getColorKeyPosition()
Vector2i gf::ConsoleFont::getColorKeyPosition |
( |
| ) |
const |
|
protected |
Get the color key position.
This function gives the position of a pixel of the space character in the font.
- Returns
- A pixel position where to find the color key
◆ getFormat()
Get the format of the font.
◆ getSize()
Vector2i gf::ConsoleFont::getSize |
( |
| ) |
const |
|
inline |
Get the size of the fonts.
- Returns
- The size in characters of the font
◆ getSubTexture()
RectI gf::ConsoleFont::getSubTexture |
( |
char16_t |
c | ) |
const |
◆ getTexture()
virtual const BareTexture* gf::ConsoleFont::getTexture |
( |
| ) |
const |
|
pure virtual |
◆ getTextureRect()
RectF gf::ConsoleFont::getTextureRect |
( |
char16_t |
c | ) |
const |
◆ logFormat()
void gf::ConsoleFont::logFormat |
( |
const Path & |
filename | ) |
const |
|
protected |
Print the format of the font.
This function logs the format of the font
- Parameters
-
filename | The filename of the source image |
◆ mapCode()
void gf::ConsoleFont::mapCode |
( |
char16_t |
c, |
|
|
Vector2i |
position |
|
) |
| |
Map a character to a position in the font.
- Parameters
-
c | A character |
position | The position, in characters, of the character |
◆ mapCodeRange()
void gf::ConsoleFont::mapCodeRange |
( |
char16_t |
c, |
|
|
int |
count, |
|
|
Vector2i |
position |
|
) |
| |
Map a range of characters to consecutive positions in the font.
- Parameters
-
c | The first character in the range |
count | The number of character in the range |
position | The position, in characters, of the first character |
◆ mapElement()
Map an element in the font.
- Parameters
-
◆ mapElements()
Map some elements in the font.
- Parameters
-
elements | The font elements |
◆ mapString()
void gf::ConsoleFont::mapString |
( |
std::string_view |
str, |
|
|
Vector2i |
position |
|
) |
| |
Map characters from a string to consecutive positions in the font.
- Parameters
-
str | The string with the characters |
position | The position, in characters, of the first character of the string |