adjust font vertical position by baseline offset
This commit is contained in:
parent
5a942a61a9
commit
b0553fdbd2
@ -12,6 +12,7 @@ public:
|
||||
std::shared_ptr<Glyph> get_glyph(FT_ULong character);
|
||||
int get_advance() { return m_advance; }
|
||||
int get_line_height() { return m_line_height; }
|
||||
int get_baseline_offset() { return m_baseline_offset; }
|
||||
|
||||
protected:
|
||||
bool preload_glyphs();
|
||||
|
@ -298,7 +298,7 @@ void Window::redraw()
|
||||
{
|
||||
uint8_t c = piece->start[i];
|
||||
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();
|
||||
if ((i + 1) % m_columns == 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user