summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2018-11-25 16:21:30 +0100
committerMichael Lutz <michi@icosahedron.de>2018-12-01 11:57:14 +0100
commit3b8db31a49b0f1b86e3bb8d8ef4233868fcd4951 (patch)
tree01bba397b2cfc2a147c4d81198909ae0e57aaa4d /src
parent88894166e8244177c20cfd1edd28bb1c38881a68 (diff)
downloadopenttd-3b8db31a49b0f1b86e3bb8d8ef4233868fcd4951.tar.xz
Fix: [Win32] Align sprite glyphs to the font baseline when using Uniscribe text layout.
Diffstat (limited to 'src')
-rw-r--r--src/os/windows/string_uniscribe.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp
index ea8b8c022..ce61537b2 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.
}
}