Mikemon/src/font_main.cpp
mikeb 1f91eb9cf1 font_creator project for font loading;
init font_main + "stbtt_InitFont";
Lexend-Regular.ttf as normal font;


git-svn-id: svn://ammerhai.com/home/mike/pokemon_repo@17 24008968-59e6-ed4c-a10b-0b2c954b24ab
2021-07-03 17:31:05 +00:00

22 lines
475 B
C++

#define STB_TRUETYPE_IMPLEMENTATION
#include "stb_truetype.h"
#include "load_entire_file.h"
#include "log.h"
int main() {
stbtt_fontinfo font_info;
String font_file = load_entire_file("../assets/fonts/Lexend-Regular.ttf");
if (!font_file.length) {
log_error("Loading font file has failed.");
return 1;
}
if (!stbtt_InitFont(&font_info, (unsigned char*)font_file.data, 0)) {
log_error("Init Font has failed.");
return 1;
}
return 0;
}