Text-Renderer/main/main.cpp

36 lines
804 B
C++
Raw Normal View History

2019-10-15 14:00:06 +02:00
#include <iostream>
2019-10-22 15:34:51 +02:00
#include "add.h"
#include "Bitmap.h"
2019-10-22 15:34:51 +02:00
#include "Font.h"
2019-10-15 14:00:06 +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-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-22 15:34:51 +02:00
for (int i = 0; i < font.height(); i++) {
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 << "";
} else {
2019-10-23 11:42:32 +02:00
std::cout << " ";
}
}
std::cout << " ";
}
std::cout << std::endl;
}
2019-10-15 14:00:06 +02:00
return 0;
}