2019-10-22 15:34:51 +02:00
|
|
|
#include "add.h"
|
2019-10-15 16:12:56 +02:00
|
|
|
#include "Bitmap.h"
|
2019-10-22 15:34:51 +02:00
|
|
|
#include "Font.h"
|
2019-10-15 14:00:06 +02:00
|
|
|
|
2019-10-23 12:18:43 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
2019-10-16 15:44:13 +02:00
|
|
|
/**
|
2019-10-15 16:12:56 +02:00
|
|
|
* @author: Julian Hinxlage
|
|
|
|
* @since: v0.0.0
|
|
|
|
* @brief: An image is loaded and used as a font.
|
|
|
|
* A string is converted and displayed in the console.
|
|
|
|
* Currently only to test.
|
|
|
|
*/
|
2019-10-15 14:00:06 +02:00
|
|
|
int main() {
|
2019-10-23 13:03:16 +02:00
|
|
|
Font font("../res/font.bmp","../res/font.toml");
|
2019-10-15 16:12:56 +02:00
|
|
|
|
2019-10-16 12:17:59 +02:00
|
|
|
std::string str;
|
|
|
|
std::cout << "string to draw: ";
|
2019-10-23 11:42:32 +02:00
|
|
|
std::getline(std::cin, str);
|
2019-10-15 16:12:56 +02:00
|
|
|
|
2019-10-22 15:34:51 +02:00
|
|
|
for (int i = 0; i < font.height(); i++) {
|
2019-10-15 16:12:56 +02:00
|
|
|
for (char c : str) {
|
2019-10-22 15:34:51 +02:00
|
|
|
for (int j = 0; j < font.width(); j++) {
|
2019-10-23 11:42:32 +02:00
|
|
|
if (font.getPixel(c,j,i)) {
|
|
|
|
std::cout << "█";
|
2019-10-15 16:12:56 +02:00
|
|
|
} else {
|
2019-10-23 11:42:32 +02:00
|
|
|
std::cout << " ";
|
2019-10-15 16:12:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
std::cout << " ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
|
2019-10-15 14:00:06 +02:00
|
|
|
return 0;
|
2019-10-23 12:18:43 +02:00
|
|
|
}
|