inbox: Synchronize the font between the WDDMCon Renderer and the SCREEN_INFORMATION (#1089)

Synchronize the font between the WDDMCon Renderer and the SCREEN_INFORMATION when the OneCore Interactivity library starts up. #21717424

Retrieved from rs_onecore_dep_acioss ccca0315e7db34c09f5fcd9dfabae666ede1687b

Fixes #958.
This commit is contained in:
Dustin L. Howett (MSFT) 2019-05-31 17:59:07 -07:00 committed by GitHub
parent 71e19cd825
commit 880272c748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 14 deletions

View File

@ -53,6 +53,8 @@ DWORD WINAPI ConsoleInputThreadProcOneCore(LPVOID /*lpParam*/)
if (NT_SUCCESS(Status))
{
globals.getConsoleInformation().GetActiveOutputBuffer().RefreshFontWithRenderer();
globals.ntstatusConsoleInputInitStatus = Status;
globals.hConsoleInputInitEvent.SetEvent();

View File

@ -339,19 +339,9 @@ HRESULT WddmConEngine::UpdateDrawingBrushes(COLORREF const /*colorForeground*/,
}
[[nodiscard]]
HRESULT WddmConEngine::UpdateFont(const FontInfoDesired& /*pfiFontInfoDesired*/, FontInfo& fiFontInfo) noexcept
HRESULT WddmConEngine::UpdateFont(const FontInfoDesired& fiFontInfoDesired, FontInfo& fiFontInfo) noexcept
{
COORD coordSize = {0};
LOG_IF_FAILED(GetFontSize(&coordSize));
fiFontInfo.SetFromEngine(fiFontInfo.GetFaceName(),
fiFontInfo.GetFamily(),
fiFontInfo.GetWeight(),
fiFontInfo.IsTrueTypeFont(),
coordSize,
coordSize);
return S_OK;
return GetProposedFont(fiFontInfoDesired, fiFontInfo, USER_DEFAULT_SCREEN_DPI);
}
[[nodiscard]]
@ -374,10 +364,20 @@ HRESULT WddmConEngine::UpdateViewport(const SMALL_RECT /*srNewViewport*/) noexce
}
[[nodiscard]]
HRESULT WddmConEngine::GetProposedFont(const FontInfoDesired& /*pfiFontInfoDesired*/,
FontInfo& /*pfiFontInfo*/,
HRESULT WddmConEngine::GetProposedFont(const FontInfoDesired& /*fiFontInfoDesired*/,
FontInfo& fiFontInfo,
int const /*iDpi*/) noexcept
{
COORD coordSize = { 0 };
LOG_IF_FAILED(GetFontSize(&coordSize));
fiFontInfo.SetFromEngine(fiFontInfo.GetFaceName(),
fiFontInfo.GetFamily(),
fiFontInfo.GetWeight(),
fiFontInfo.IsTrueTypeFont(),
coordSize,
coordSize);
return S_OK;
}