adjust font vertical position by baseline offset

This commit is contained in:
Josh Holtrop 2016-07-31 23:11:26 -04:00
parent 5a942a61a9
commit b0553fdbd2
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ public:
std::shared_ptr<Glyph> get_glyph(FT_ULong character); std::shared_ptr<Glyph> get_glyph(FT_ULong character);
int get_advance() { return m_advance; } int get_advance() { return m_advance; }
int get_line_height() { return m_line_height; } int get_line_height() { return m_line_height; }
int get_baseline_offset() { return m_baseline_offset; }
protected: protected:
bool preload_glyphs(); bool preload_glyphs();

View File

@ -298,7 +298,7 @@ void Window::redraw()
{ {
uint8_t c = piece->start[i]; uint8_t c = piece->start[i];
auto g = m_font.get_glyph(c); auto g = m_font.get_glyph(c);
m_shaders.text->set_position(x, y); m_shaders.text->set_position(x, y + m_font.get_baseline_offset());
g->render(); g->render();
if ((i + 1) % m_columns == 0) if ((i + 1) % m_columns == 0)
{ {