MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / SetCurrentFont

Method SetCurrentFont

source/script_gui.cpp:7957–7971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7955
7956
7957ResultType GuiType::SetCurrentFont(LPTSTR aOptions, LPTSTR aFontName)
7958{
7959 COLORREF color;
7960 int font_index = FindOrCreateFont(aOptions, aFontName, &sFont[mCurrentFontIndex], &color);
7961 if (color != CLR_NONE) // Even if the above call failed, it returns a color if one was specified.
7962 mCurrentColor = color;
7963 if (font_index > -1) // Success.
7964 {
7965 mCurrentFontIndex = font_index;
7966 return OK;
7967 }
7968 // Failure of the above is rare because it falls back to default typeface if the one specified
7969 // isn't found. It will have already displayed the error:
7970 return FAIL;
7971}
7972
7973
7974

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected