add layout designer

This commit is contained in:
2019-09-26 09:55:54 +02:00
parent f9bddfddad
commit 0a8c3aeaf2
7 changed files with 35 additions and 7 deletions

View File

@@ -21,6 +21,9 @@ bool Font::load(const std::string& ttf, int font_size, float font_scale)
LOG("Font::load loaded");
auto bitmap = std::make_unique<uint8_t[]>(w*h);
chars.resize(num_chars);
//int offset = stbtt_FindMatchingFont(file.m_data, "Arial Bold", STBTT_MACSTYLE_DONTCARE);
//if (offset < 0)
// offset = 0;
stbtt_BakeFontBitmap(file.m_data, 0, (float)font_size*scale, bitmap.get(), w, h, start_char, num_chars, chars.data());
calc_bounds();
font_tex.create(w, h, GL_R8, GL_RED, bitmap.get());