From 3b8db31a49b0f1b86e3bb8d8ef4233868fcd4951 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 25 Nov 2018 16:21:30 +0100 Subject: [PATCH] Fix: [Win32] Align sprite glyphs to the font baseline when using Uniscribe text layout. --- src/os/windows/string_uniscribe.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index ea8b8c0224..ce61537b2b 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -195,6 +195,7 @@ static bool UniscribeShapeRun(const UniscribeParagraphLayoutFactory::CharType *b for (int i = 0; i < range.len; i++) { if (buff[range.pos + i] >= SCC_SPRITE_START && buff[range.pos + i] <= SCC_SPRITE_END) { range.ft_glyphs[range.char_to_glyph[i]] = range.font->fc->MapCharToGlyph(buff[range.pos + i]); + range.offsets[range.char_to_glyph[i]].dv = range.font->fc->GetAscender() - range.font->fc->GetGlyph(range.ft_glyphs[range.char_to_glyph[i]])->height - 1; // Align sprite glyphs to font baseline. } }