36 lines
804 B
C++
36 lines
804 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::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;
|
|
} |