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
22 lines
475 B
C++
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;
|
|
} |