29 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72
59 DPRINT1(
"RefreshFontPreview: CreateConsoleFont() failed\n");
64 Preview->hFont =
hFont;
65 GetFontCellSize(
NULL,
hFont, &Preview->CharHeight, &Preview->CharWidth);
76 Preview->hFont =
hFont;
145 WCHAR szFontSize[100];
153 if (SizeList->UseRasterOrTTList)
158 SizeList->CurrentRasterSize = FontSize;
167 else if (nSel >=
idx)
180 SizeList->CurrentTTSize = FontSize;
192 SizeList->bIsTTSizeDirty =
TRUE;
205 WCHAR szFontSize[100];
207 if (SizeList->UseRasterOrTTList)
212 if (nSel ==
LB_ERR)
return 0;
214 FontSize = (
LONG)SizeList->RasterSizeList.GetData(&SizeList->RasterSizeList, nSel);
215 if (FontSize ==
LB_ERR)
return 0;
217 SizeList->CurrentRasterSize = FontSize;
223 if (!SizeList->bIsTTSizeDirty)
234 if (nSel ==
CB_ERR)
return 0;
244 FontSize =
wcstoul(szFontSize, &pszNext, 10);
245 if ((FontSize == 0) || (*pszNext))
255 FontSize =
wcstoul(szFontSize, &pszNext, 10);
256 if ((FontSize == 0) || (*pszNext))
271 SizeList->bIsTTSizeDirty =
FALSE;
273 SizeList->CurrentTTSize = FontSize;
279 if (!SizeList->TTSizePixelUnit)
303 DPRINT1(
"Failed to add font '%S'\n", pszFaceName);
307 DPRINT1(
"Add font '%S'\n", pszFaceName);
347 UINT iItem, iDupItem;
348 WCHAR szFontSize[100];
361 FontSize =
MAKEWPARAM(lplf->lfWidth, lplf->lfHeight);
429 DPRINT1(
"The ideal console fonts were not found; manually add default ones.\n");
469 SizeList->CurrentRasterSize =
MAKELONG(FontSize.X, FontSize.Y);
470 SizeList->CurrentTTSize = FontSize.Y;
483 if (SizeList->UseRasterOrTTList)
500 hDlgItem = SizeList->hWndTTSizeList;
504 hDlgItem = SizeList->RasterSizeList.hWndList;
517 hDlgItem = SizeList->RasterSizeList.hWndList;
521 hDlgItem = SizeList->hWndTTSizeList;
552 WCHAR FontGrpBoxLabel[260];
581 DPRINT(
"pConInfo->FaceName = '%S'\n", pConInfo->FaceName);
588 if (FontGrpBoxLabelTpl &&
Length > 0)
621 if (SizeList->UseRasterOrTTList)
636 if (SizeList->UseRasterOrTTList)
645 SizeList->UseRasterOrTTList =
TRUE;
664 WCHAR szFontSize[100];
686 DPRINT1(
"FontSizeChange: CreateConsoleFont2() failed\n");
705 pConInfo->FontSize.X = (
SHORT)(SizeList->UseRasterOrTTList ?
CharWidth : 0);
708 DPRINT(
"pConInfo->FontSize = (%d x %d) ; (CharWidth x CharHeight) = (%d x %d)\n",
752 SizeList->UseRasterOrTTList =
TRUE;
756 SizeList->TTSizePixelUnit =
TRUE;
785 case WM_DISPLAYCHANGE:
889 WCHAR szFontSize[100];
890 WCHAR szMessage[260];
896 FontSize =
wcstoul(szFontSize, &pszNext, 10);
897 if ((FontSize == 0) || (*pszNext))
INT PointSizeToLogicalSize(IN HDC hDC OPTIONAL, IN INT PointSize)
static BOOL CALLBACK EnumFontSizesProc(IN PLOGFONTW lplf, IN PNEWTEXTMETRICW lpntm, IN DWORD FontType, IN LPARAM lParam)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDC_RADIO_POINT_UNIT
int WINAPI EnumFontFamiliesExW(HDC hdc, LPLOGFONTW lpLogfont, FONTENUMPROCW lpEnumFontFamExProc, LPARAM lParam, DWORD dwFlags)
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define LB_FINDSTRINGEXACT
#define IDC_RADIO_PIXEL_UNIT
VOID UpdateFontPreview(IN FONT_PREVIEW *Preview, IN HFONT hFont, IN UINT CharWidth, IN UINT CharHeight)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
INT LogicalSizeToPointSize(IN HDC hDC OPTIONAL, IN UINT LogicalSize)
static LONG(WINAPI *pGdiGetCharDimensions)(HDC hdc
HDC WINAPI GetDC(_In_opt_ HWND)
HFONT CreateConsoleFont(_Inout_ PCONSOLE_STATE_INFO ConsoleInfo)
A wrapper for CreateConsoleFontEx().
#define IDC_CHECK_BOLD_FONTS
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define GetWindowLongPtrW
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
static HWND hWndList[5+1]
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static INT RasterSizeList_GetCount(IN PLIST_CTL ListCtl)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define IDC_CBOX_FONTSIZE
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
static VOID AddFontToList(IN HWND hWndList, IN LPCWSTR pszFaceName, IN DWORD FontType)
static const SHORT TrueTypePoints[]
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static UINT CurrentCodePage
struct _FONTSIZE_LIST_CTL * PFONTSIZE_LIST_CTL
VOID ApplyConsoleInfo(HWND hwndDlg)
static ULONG_PTR RasterSizeList_GetData(IN PLIST_CTL ListCtl, IN INT Index)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
static VOID FontSizeList_SelectFontSize(IN PFONTSIZE_LIST_CTL SizeList, IN ULONG FontSize)
#define IDC_GROUPBOX_FONT_NAME
HFONT CreateConsoleFont2(_In_ LONG Height, _In_opt_ LONG Width, _Inout_ PCONSOLE_STATE_INFO ConsoleInfo)
A wrapper for CreateConsoleFontEx().
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
VOID RefreshFontPreview(IN FONT_PREVIEW *Preview, IN PCONSOLE_STATE_INFO pConInfo)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
static BOOL FontSizeChange(IN HWND hDlg, IN PFONTSIZE_LIST_CTL SizeList, IN OUT PCONSOLE_STATE_INFO pConInfo)
_In_ WDFCOLLECTION _In_ ULONG Index
#define IDC_STATIC_FONT_WINDOW_PREVIEW
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
struct _FONTSIZE_LIST_CTL FONTSIZE_LIST_CTL
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static VOID FaceNameList_Initialize(IN HWND hWndList, IN UINT CodePage)
#define MB_ICONINFORMATION
WCHAR FaceName[LF_FACESIZE]
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define IDS_GROUPBOX_FONT_NAME
#define IDC_LBOX_FONTSIZE
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define IDC_STATIC_SELECT_FONT_PREVIEW
static BOOL CALLBACK EnumFaceNamesProc(IN PLOGFONTW lplf, IN PNEWTEXTMETRICW lpntm, IN DWORD FontType, IN LPARAM lParam)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
static LONG FontSizeList_GetSelectedFontSize(IN PFONTSIZE_LIST_CTL SizeList)
#define IDC_LBOX_FONTTYPE
static INT(WINAPI *pAddFontResourceExA)(LPCSTR
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
PCONSOLE_STATE_INFO ConInfo
struct _FACE_NAMES_PROC_PARAM FACE_NAMES_PROC_PARAM
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
WCHAR lfFaceName[LF_FACESIZE]
BOOL IsValidConsoleFont2(_In_ PLOGFONTW lplf, _In_ PNEWTEXTMETRICW lpntm, _In_ DWORD FontType, _In_ UINT CodePage)
Validates whether a given font can be supported in the console, under the specified code page.
static BOOL FontTypeChange(IN HWND hDlg, IN PFONTSIZE_LIST_CTL SizeList, IN OUT PCONSOLE_STATE_INFO pConInfo)
static VOID UpdateFontSizeList(IN HWND hDlg, IN PFONTSIZE_LIST_CTL SizeList)
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define SetWindowLongPtrW
static INT CurrentSelFont
static VOID FaceNameList_SelectFont(IN HWND hDlg, IN HWND hWndList, IN PFONTSIZE_LIST_CTL SizeList, IN LPCWSTR FaceName, IN ULONG FontFamily, IN ULONG FontWeight, IN COORD FontSize)
static DWORD CurrentFontType
UINT BisectListSortedByValue(IN PLIST_CTL ListCtl, IN ULONG_PTR Value, OUT PUINT pValueItem OPTIONAL, IN BOOL BisectRightOrLeft)
VOID PaintText(IN LPDRAWITEMSTRUCT drawItem, IN PCONSOLE_STATE_INFO pConInfo, IN TEXT_TYPE TextMode)
#define HeapFree(x, y, z)
INT_PTR CALLBACK FontProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define TRUETYPE_FONTTYPE
struct _FACE_NAMES_PROC_PARAM * PFACE_NAMES_PROC_PARAM
PULONG MinorVersion OPTIONAL
#define CB_FINDSTRINGEXACT