2019-10-15 14:00:06 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
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-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-22 15:34:51 +02:00
|
|
|
Font font("../res/font.bmp");
|
2019-10-15 16:12:56 +02:00
|
|
|
|
2019-10-16 12:17:59 +02:00
|
|
|
std::string str;
|
|
|
|
std::cout << "string to draw: ";
|
|
|
|
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-15 16:12:56 +02:00
|
|
|
|
2019-10-22 15:34:51 +02:00
|
|
|
unsigned int pixel = font.getPixel(c,j,i);
|
2019-10-16 12:17:59 +02:00
|
|
|
|
|
|
|
if (pixel == 0) {
|
2019-10-15 16:12:56 +02:00
|
|
|
std::cout << " ";
|
|
|
|
} else {
|
2019-10-22 15:34:51 +02:00
|
|
|
std::cout << "1";
|
2019-10-15 16:12:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
std::cout << " ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
|
2019-10-15 14:00:06 +02:00
|
|
|
return 0;
|
|
|
|
}
|