Changeset - r24758:0ea535e59ac7
[Not reviewed]
master
0 3 0
Michael Lutz - 3 years ago 2021-01-06 21:56:44
michi@icosahedron.de
Codechange: Make OS font handle of the FontCache read-only.
3 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/fontcache.cpp
Show inline comments
 
@@ -756,7 +756,7 @@ public:
 
	virtual GlyphID MapCharToGlyph(WChar key);
 
	virtual const char *GetFontName() { return WIDE_TO_MB(this->logfont.lfFaceName); }
 
	virtual bool IsBuiltInFont() { return false; }
 
	virtual void *GetOSHandle() { return &this->logfont; }
 
	virtual const void *GetOSHandle() { return &this->logfont; }
 
};
 

	
 

	
src/fontcache.h
Show inline comments
 
@@ -127,7 +127,7 @@ public:
 
	 * Get the native OS font handle, if there is one.
 
	 * @return Opaque OS font handle.
 
	 */
 
	virtual void *GetOSHandle()
 
	virtual const void *GetOSHandle()
 
	{
 
		return nullptr;
 
	}
src/os/windows/string_uniscribe.cpp
Show inline comments
 
@@ -144,7 +144,7 @@ void UniscribeResetScriptCache(FontSize 
 
/** Load the matching native Windows 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;
 
	ZeroMemory(&logfont, sizeof(LOGFONT));
0 comments (0 inline, 0 general)