summaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2018-11-25 02:02:20 +0100
committerOwen Rudge <owen@owenrudge.net>2019-05-14 11:21:36 +0100
commitd2ed4260772e0a2ce8805e9c40525d0abb9345ea (patch)
tree2daef56dc038e55aa630a4f55f8af0eeeaff9b06 /src/os
parent2675762ae9c58c47dc442b422927206c7bee13a8 (diff)
downloadopenttd-d2ed4260772e0a2ce8805e9c40525d0abb9345ea.tar.xz
Codechange: [Win32] Pass a native GDI font description around when we have one, instead of repeatedly guessing the font.
Diffstat (limited to 'src/os')
-rw-r--r--src/os/windows/string_uniscribe.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp
index 8c4e11d3f..01f0e5e3b 100644
--- a/src/os/windows/string_uniscribe.cpp
+++ b/src/os/windows/string_uniscribe.cpp
@@ -148,6 +148,8 @@ void UniscribeResetScriptCache(FontSize size)
/** Load the matching native Windows font. */
static HFONT HFontFromFont(Font *font)
{
+ if (font->fc->GetOSHandle() != nullptr) return CreateFontIndirect((PLOGFONT)font->fc->GetOSHandle());
+
LOGFONT logfont;
ZeroMemory(&logfont, sizeof(LOGFONT));
logfont.lfHeight = font->fc->GetHeight();