Text-Renderer/main/main.cpp

37 lines
824 B
C++

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