Fix font preview for conhost (#16324)
After exiting the main loop in this function the invariant `nFont <= NumberOfFonts` still holds true. Additionally, preceding this removed code is this (paraphrased): ```cpp if (nFont < NumberOfFonts) { RtlMoveMemory(...); } ``` It ensures that the given slot `nFont` is always unoccupied by moving it and all following items upwards if needed. As such, the call to `DeleteObject` is always incorrect, as the slot is always "empty", but may contain a copy of the previous occupant due to the `memmove`. This regressed in154ac2b
. Closes #16297 ## Validation Steps Performed * All fonts have a unique look in the preview panel ✅ (cherry picked from commit35240f263e
) Service-Card-Id: 91120871 Service-Version: 1.19
This commit is contained in:
parent
e727aaf679
commit
48a6d92255
|
@ -398,10 +398,6 @@ CreateBoldFont:
|
|||
/*
|
||||
* Store the font info
|
||||
*/
|
||||
if (FontInfo[nFont].hFont != nullptr)
|
||||
{
|
||||
DeleteObject(FontInfo[nFont].hFont);
|
||||
}
|
||||
FontInfo[nFont].hFont = hFont;
|
||||
FontInfo[nFont].Family = tmFamily;
|
||||
FontInfo[nFont].Size = SizeActual;
|
||||
|
|
Loading…
Reference in New Issue