summaryrefslogtreecommitdiff
path: root/src/fontcache.h
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/fontcache.h
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/fontcache.h')
-rw-r--r--src/fontcache.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/fontcache.h b/src/fontcache.h
index 62ce596f3..741610395 100644
--- a/src/fontcache.h
+++ b/src/fontcache.h
@@ -126,6 +126,15 @@ public:
virtual const void *GetFontTable(uint32 tag, size_t &length) = 0;
/**
+ * Get the native OS font handle, if there is one.
+ * @return Opaque OS font handle.
+ */
+ virtual void *GetOSHandle()
+ {
+ return nullptr;
+ }
+
+ /**
* Get the name of this font.
* @return The name of the font.
*/
@@ -209,6 +218,8 @@ struct FreeTypeSubSetting {
char font[MAX_PATH]; ///< The name of the font, or path to the font.
uint size; ///< The (requested) size of the font.
bool aa; ///< Whether to do anti aliasing or not.
+
+ const void *os_handle = nullptr; ///< Optional native OS font info.
};
/** Settings for the freetype fonts. */