[CONCFG:FONT][CONSRV] Use a suitable font when changing console output CP; fail if...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 29 Jan 2022 19:04:16 +0000 (20:04 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 8 Feb 2022 14:59:07 +0000 (15:59 +0100)
commit5d3915d0fcc465f65a6146b3d6bd9c050638dc18
tree27fba76bde906eec77c05b1270edb48bc0958ef9
parenta94436b5194ca86fedc759c63f79653c85e281a0
[CONCFG:FONT][CONSRV] Use a suitable font when changing console output CP; fail if none found. (#4337)

CORE-12451, CORE-17601, CORE-17803
Replaces PR #4281.

When changing the console output code page, check whether the current
font can support it. If not, try to find a suitable font for the new
code page. If none can be found:

- if we are creating a new console, forcefully switch to codepage 437
  (OEM USA) and retry finding a font, falling back to "Terminal" if
  none could be found;

- if we were just changing the current CP, just fail and keep the old
  code page and font.

Rework the console font selection/creation functions for this new job
(see CreateConsoleFontEx() and friends). Elements of implementation
based from https://github.com/microsoft/terminal ; see code for more
information.

Silence the noisy IsValidConsoleFont2() diagnostic messages.

Add Doxygen documentation.

[CONSOLE.CPL] Only add "Terminal" to the enumerated list of faces
+ add a TODO implementation comment.
dll/cpl/console/font.c
win32ss/user/winsrv/concfg/font.c
win32ss/user/winsrv/concfg/font.h
win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
win32ss/user/winsrv/consrv/frontends/gui/guiterm.h