Text-Renderer/main/main.cpp

39 lines
841 B
C++

#include <iostream>
#include "add.h"
#include "Bitmap.h"
#include "Font.h"
/**
* @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.
*/
int main() {
Font font("../res/font.bmp");
std::string str;
std::cout << "string to draw: ";
std::cin >> str;
for (int i = 0; i < font.height(); i++) {
for (char c : str) {
for (int j = 0; j < font.width(); j++) {
unsigned int pixel = font.getPixel(c,j,i);
if (pixel == 0) {
std::cout << " ";
} else {
std::cout << "1";
}
}
std::cout << " ";
}
std::cout << std::endl;
}
return 0;
}