mirror of
https://onedev.site.tesses.net/tesses-framework/tessesframework-gfx
synced 2026-02-08 16:35:45 +00:00
Initial commit
This commit is contained in:
38
examples/drawfont.cpp
Normal file
38
examples/drawfont.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "TessesFrameworkGFX/TessesFrameworkGFX.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Graphics;
|
||||
using namespace Tesses::Framework::Graphics::ImageFormats;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
||||
TF_InitWithConsole();
|
||||
Image img;
|
||||
|
||||
auto strm = std::make_shared<FileStream>(argv[1],"wb");
|
||||
std::vector<std::string> chrs = {
|
||||
"!\"#$%&\'(",
|
||||
")*+,-./0",
|
||||
"12345678",
|
||||
"9:;<=>?@",
|
||||
"ABCDEFGH",
|
||||
"IJKLMNOP",
|
||||
"QRSTUVWX",
|
||||
"YZ[\\]^_`",
|
||||
"{|}~TGFX"
|
||||
};
|
||||
img.SetSize(144,(uint32_t)(18*chrs.size()),Colors::White);
|
||||
for(int y = 0; y < chrs.size(); y++)
|
||||
{
|
||||
for(int x = 0; x < 8; x++)
|
||||
{
|
||||
img.DrawChar(chrs[y][x],Point(1+(18*x),1+(18*y)),Colors::Black);
|
||||
}
|
||||
}
|
||||
|
||||
Formats::Png.Save(strm,&img);
|
||||
}
|
||||
Reference in New Issue
Block a user