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

Method FindFont

source/script_gui.cpp:8163–8175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8161
8162
8163int GuiType::FindFont(FontType &aFont)
8164{
8165 for (int i = 0; i < sFontCount; ++i)
8166 if (!_tcsicmp(sFont[i].lfFaceName, aFont.lfFaceName) // lstrcmpi() is not used: 1) avoids breaking existing scripts; 2) provides consistent behavior across multiple locales.
8167 && sFont[i].lfHeight == aFont.lfHeight // There's no risk of mismatch between cell height (positive) and character height (negative), since we always set it to the latter.
8168 && sFont[i].lfWeight == aFont.lfWeight
8169 && sFont[i].lfItalic == aFont.lfItalic
8170 && sFont[i].lfUnderline == aFont.lfUnderline
8171 && sFont[i].lfStrikeOut == aFont.lfStrikeOut
8172 && sFont[i].lfQuality == aFont.lfQuality) // Match found.
8173 return i;
8174 return -1; // Indicate failure.
8175}
8176
8177
8178

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected