Codechange: [Win32] Pass a native GDI font description around when we have one, instead of repeatedly guessing the font.

This commit is contained in:
Michael Lutz
2018-11-25 02:02:20 +01:00
committed by Owen Rudge
parent 2675762ae9
commit d2ed426077
8 changed files with 46 additions and 13 deletions

View File

@@ -148,6 +148,8 @@ void UniscribeResetScriptCache(FontSize size)
/** Load the matching native Windows font. */
static HFONT HFontFromFont(Font *font)
{
if (font->fc->GetOSHandle() != nullptr) return CreateFontIndirect((PLOGFONT)font->fc->GetOSHandle());
LOGFONT logfont;
ZeroMemory(&logfont, sizeof(LOGFONT));
logfont.lfHeight = font->fc->GetHeight();