reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
Hermès Bélusca-Maïto 5d3915d0fc
[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.
2022-02-08 15:59:07 +01:00

49 lines
1.5 KiB
C

/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Console Server DLL
* FILE: win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
* PURPOSE: GUI front-end settings management
* PROGRAMMERS: Johannes Anderwald
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
*
* NOTE: Also used by console.dll
*/
#pragma once
/* STRUCTURES *****************************************************************/
typedef struct _GUI_CONSOLE_INFO
{
WCHAR FaceName[LF_FACESIZE];
ULONG FontWeight;
ULONG FontFamily;
COORD FontSize;
BOOL FullScreen; /* Whether the console is displayed in full-screen or windowed mode */
// ULONG HardwareState; /* _GDI_MANAGED, _DIRECT */
WORD ShowWindow;
BOOL AutoPosition;
POINT WindowOrigin;
} GUI_CONSOLE_INFO, *PGUI_CONSOLE_INFO;
#ifndef CONSOLE_H__ // If we aren't included by console.dll
#include "conwnd.h"
/* FUNCTIONS ******************************************************************/
BOOL GuiConsoleReadUserSettings(IN OUT PGUI_CONSOLE_INFO TermInfo);
BOOL GuiConsoleWriteUserSettings(IN OUT PGUI_CONSOLE_INFO TermInfo);
VOID GuiConsoleGetDefaultSettings(IN OUT PGUI_CONSOLE_INFO TermInfo);
VOID GuiConsoleShowConsoleProperties(PGUI_CONSOLE_DATA GuiData,
BOOL Defaults);
VOID GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData,
HANDLE hClientSection);
#endif
/* EOF */