mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Make OS font handle of the FontCache read-only.
parent
2b0200d429
commit
5ad1640984
|
@ -756,7 +756,7 @@ public:
|
||||||
virtual GlyphID MapCharToGlyph(WChar key);
|
virtual GlyphID MapCharToGlyph(WChar key);
|
||||||
virtual const char *GetFontName() { return WIDE_TO_MB(this->logfont.lfFaceName); }
|
virtual const char *GetFontName() { return WIDE_TO_MB(this->logfont.lfFaceName); }
|
||||||
virtual bool IsBuiltInFont() { return false; }
|
virtual bool IsBuiltInFont() { return false; }
|
||||||
virtual void *GetOSHandle() { return &this->logfont; }
|
virtual const void *GetOSHandle() { return &this->logfont; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ public:
|
||||||
* Get the native OS font handle, if there is one.
|
* Get the native OS font handle, if there is one.
|
||||||
* @return Opaque OS font handle.
|
* @return Opaque OS font handle.
|
||||||
*/
|
*/
|
||||||
virtual void *GetOSHandle()
|
virtual const void *GetOSHandle()
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ void UniscribeResetScriptCache(FontSize size)
|
||||||
/** Load the matching native Windows font. */
|
/** Load the matching native Windows font. */
|
||||||
static HFONT HFontFromFont(Font *font)
|
static HFONT HFontFromFont(Font *font)
|
||||||
{
|
{
|
||||||
if (font->fc->GetOSHandle() != nullptr) return CreateFontIndirect((PLOGFONT)font->fc->GetOSHandle());
|
if (font->fc->GetOSHandle() != nullptr) return CreateFontIndirect((const PLOGFONT)font->fc->GetOSHandle());
|
||||||
|
|
||||||
LOGFONT logfont;
|
LOGFONT logfont;
|
||||||
ZeroMemory(&logfont, sizeof(LOGFONT));
|
ZeroMemory(&logfont, sizeof(LOGFONT));
|
||||||
|
|
Loading…
Reference in New Issue