change font scale based on ui scale, fix brush outline color

This commit is contained in:
2019-08-08 23:50:45 +02:00
parent 34464c167e
commit 67dd9a2456
6 changed files with 59 additions and 25 deletions

View File

@@ -21,9 +21,12 @@ public:
int size = 0;
stbtt_fontinfo font;
Texture2D font_tex;
std::string path;
std::vector<stbtt_bakedchar> chars;
float scale = 1.f;
bool load(const char* ttf, int sz);
bool load(const std::string& ttf, int sz, float scale);
void change_scale(float scale);
void calc_bounds();
};
@@ -33,9 +36,10 @@ public:
static std::map<kFont, Font> m_fonts;
static Sampler m_sampler;
static void init();
static bool load(kFont id, const char* ttf, int sz);
static bool load(kFont id, const char* ttf, int sz, float scale);
static const Font& get(kFont id);
static void invalidate() { m_fonts.clear(); }
static void change_scale(float scale);
};
class TextMesh