MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CmdConfigSetFont

Function CmdConfigSetFont

source/Debugger/Debugger_Win32.cpp:450–512  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

448
449//===========================================================================
450Update_t CmdConfigSetFont(int nArgs)
451{
452#if OLD_FONT
453 HFONT hFont = (HFONT)0;
454 char* pFontName = NULL;
455 int nHeight = g_nFontHeight;
456 int iFontTarget = FONT_DISASM_DEFAULT;
457 int iFontPitch = FIXED_PITCH | FF_MODERN;
458 // int iFontMode =
459 bool bHaveTarget = false;
460 bool bHaveFont = false;
461
462 if (!nArgs)
463 { // reset to defaut font
464 pFontName = g_sFontNameDefault;
465 }
466 else
467 if (nArgs <= 3)
468 {
469 int iArg = 1;
470 pFontName = g_aArgs[1].sArg;
471
472 // [DISASM|INFO|CONSOLE] "FontName" [#]
473 // "FontName" can be either arg 1 or 2
474
475 int iFound;
476 int nFound = FindParam(g_aArgs[iArg].sArg, MATCH_EXACT, iFound, _PARAM_WINDOW_BEGIN, _PARAM_WINDOW_END);
477 if (nFound)
478 {
479 switch (iFound)
480 {
481 case PARAM_DISASM: iFontTarget = FONT_DISASM_DEFAULT; iFontPitch = FIXED_PITCH | FF_MODERN; bHaveTarget = true; break;
482 case PARAM_INFO: iFontTarget = FONT_INFO; iFontPitch = FIXED_PITCH | FF_MODERN; bHaveTarget = true; break;
483 case PARAM_CONSOLE: iFontTarget = FONT_CONSOLE; iFontPitch = DEFAULT_PITCH | FF_DECORATIVE; bHaveTarget = true; break;
484 default:
485 if (g_aArgs[2].bType != TOKEN_QUOTE_DOUBLE)
486 return Help_Arg_1(CMD_CONFIG_FONT);
487 break;
488 }
489 if (bHaveTarget)
490 {
491 pFontName = g_aArgs[2].sArg;
492 }
493 }
494 else
495 if (nArgs == 2)
496 {
497 nHeight = atoi(g_aArgs[2].sArg);
498 if ((nHeight < 6) || (nHeight > 36))
499 nHeight = g_nFontHeight;
500 }
501 }
502 else
503 {
504 return Help_Arg_1(CMD_CONFIG_FONT);
505 }
506
507 if (!_CmdConfigFont(iFontTarget, pFontName, iFontPitch, nHeight))

Callers 1

CmdConfigFontFunction · 0.85

Calls 3

FindParamFunction · 0.85
Help_Arg_1Function · 0.85
_CmdConfigFontFunction · 0.85

Tested by

no test coverage detected