summaryrefslogtreecommitdiff
path: root/src/fontdetection.cpp
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/fontdetection.cpp
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/fontdetection.cpp')
-rw-r--r--src/fontdetection.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fontdetection.cpp b/src/fontdetection.cpp
index f7465a268..7b2a6756c 100644
--- a/src/fontdetection.cpp
+++ b/src/fontdetection.cpp
@@ -346,7 +346,9 @@ static int CALLBACK EnumFontCallback(const ENUMLOGFONTEX *logfont, const NEWTEXT
const char *english_name = font_name;
#endif /* WITH_FREETYPE */
- info->callback->SetFontNames(info->settings, font_name);
+ PLOGFONT os_data = MallocT<LOGFONT>(1);
+ *os_data = logfont->elfLogFont;
+ info->callback->SetFontNames(info->settings, font_name, os_data);
if (info->callback->FindMissingGlyphs(nullptr)) return 1;
DEBUG(freetype, 1, "Fallback font: %s (%s)", font_name, english_name);
return 0; // stop enumerating