Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers

This commit is contained in:
Niels Martin Hansen
2021-02-21 17:03:19 +01:00
parent 825867f2c5
commit e0561dbded
17 changed files with 109 additions and 100 deletions

View File

@@ -21,6 +21,7 @@ private:
HDC dc = nullptr; ///< Cached GDI device context.
HGDIOBJ old_font; ///< Old font selected into the GDI context.
SIZE glyph_size; ///< Maximum size of regular glyphs.
std::string fontname; ///< Cached copy of this->logfont.lfFaceName
void SetFontSize(FontSize fs, int pixels);
@@ -33,7 +34,7 @@ public:
~Win32FontCache();
void ClearFontCache() override;
GlyphID MapCharToGlyph(WChar key) override;
const char *GetFontName() override { return FS2OTTD(this->logfont.lfFaceName); }
const char *GetFontName() override { return this->fontname.c_str(); }
const void *GetOSHandle() override { return &this->logfont; }
};