adjust font vertical position by baseline offset
This commit is contained in:
1 parent
5a942a61a9
commit
b0553fdbd2
2 files changed
+2
-1
No files matched your search
@@ -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();
|
||||
|
||||
+1
-1
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user