52 lines
928 B
C
52 lines
928 B
C
|
//
|
||
|
// Created by yukun on 05.12.19.
|
||
|
//
|
||
|
|
||
|
#ifndef TERMINAL_FONT_H
|
||
|
#define TERMINAL_FONT_H
|
||
|
#include "Bitmap.h"
|
||
|
|
||
|
/**
|
||
|
* @author: Julian Hinxlage
|
||
|
* @since: v0.0.0
|
||
|
* @brief: this class provides pixel access based on characters
|
||
|
*/
|
||
|
class Font {
|
||
|
public:
|
||
|
Bitmap bitmap;
|
||
|
|
||
|
//space between characters
|
||
|
int xOffset;
|
||
|
int yOffset;
|
||
|
|
||
|
//size of a character
|
||
|
int xSize;
|
||
|
int ySize;
|
||
|
|
||
|
//count of characters per row
|
||
|
int xCount;
|
||
|
//count of rows
|
||
|
int yCount;
|
||
|
|
||
|
//pixel offset of first character
|
||
|
int xStart;
|
||
|
int yStart;
|
||
|
|
||
|
unsigned int fillValue;
|
||
|
char firstChar;
|
||
|
int pixelSize;
|
||
|
int gap;
|
||
|
|
||
|
bool invertedColors;
|
||
|
|
||
|
Font();
|
||
|
explicit Font(const std::string &file, const std::string &configFile);
|
||
|
void load(const std::string &file, const std::string &configFile);
|
||
|
|
||
|
int width();
|
||
|
int height();
|
||
|
bool getPixel(char character, int x, int y);
|
||
|
};
|
||
|
|
||
|
#endif //TERMINAL_FONT_H
|