libui: Render font characters properly with no spacing, matching the width calculations
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
4b47a24bb1
commit
2dff2c9934
@ -65,8 +65,6 @@ namespace ui
|
|||||||
|
|
||||||
void Font::render(wchar_t codepoint, ui::Color color, ui::Canvas& canvas)
|
void Font::render(wchar_t codepoint, ui::Color color, ui::Canvas& canvas)
|
||||||
{
|
{
|
||||||
check(canvas.width == m_psf_header.width && canvas.height == m_psf_header.height);
|
|
||||||
|
|
||||||
const wchar_t str[] = { codepoint, 0 };
|
const wchar_t str[] = { codepoint, 0 };
|
||||||
render(str, color, canvas);
|
render(str, color, canvas);
|
||||||
}
|
}
|
||||||
@ -98,7 +96,7 @@ namespace ui
|
|||||||
m_font_data.data() + (codepoint > 0 && codepoint < (wchar_t)m_psf_header.numglyph ? codepoint : 0) *
|
m_font_data.data() + (codepoint > 0 && codepoint < (wchar_t)m_psf_header.numglyph ? codepoint : 0) *
|
||||||
m_psf_header.bytesperglyph;
|
m_psf_header.bytesperglyph;
|
||||||
|
|
||||||
u32 offset = (u32)i * (m_psf_header.width + 1) * BYTES_PER_PIXEL;
|
u32 offset = (u32)i * m_psf_header.width * BYTES_PER_PIXEL;
|
||||||
for (int y = 0; y < height; y++)
|
for (int y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
u32 line = offset;
|
u32 line = offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user