MCPcopy Create free account
hub / github.com/NetHack/NetHack / mswin_create_splashfont

Function mswin_create_splashfont

win/win32/mhfont.c:21–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19static void __cdecl font_table_cleanup(void);
20
21HFONT
22mswin_create_splashfont(HWND hWnd)
23{
24 HDC hdc = GetDC(hWnd);
25 double scale = win10_monitor_scale(hWnd);
26 LOGFONT lgfnt;
27 ZeroMemory(&lgfnt, sizeof(lgfnt));
28 lgfnt.lfHeight = -(int)(80 * scale); // height of font
29 lgfnt.lfWidth = 0; // average character width
30 lgfnt.lfEscapement = 0; // angle of escapement
31 lgfnt.lfOrientation = 0; // base-line orientation angle
32 lgfnt.lfWeight = FW_BOLD; // font weight
33 lgfnt.lfItalic = FALSE; // italic attribute option
34 lgfnt.lfUnderline = FALSE; // underline attribute option
35 lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
36 lgfnt.lfCharSet = ANSI_CHARSET; // character set identifier
37 lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
38 lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
39 lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
40 lgfnt.lfPitchAndFamily = DEFAULT_PITCH; // pitch and family
41 NH_A2W("Times New Roman", lgfnt.lfFaceName, LF_FACESIZE);
42 HFONT font = CreateFontIndirect(&lgfnt);
43 ReleaseDC(hWnd, hdc);
44
45 return font;
46}
47
48BOOL
49mswin_font_supports_unicode(HFONT hFont)

Callers 1

mswin_set_splash_dataFunction · 0.85

Calls 1

win10_monitor_scaleFunction · 0.85

Tested by

no test coverage detected