| 137 | } |
| 138 | |
| 139 | void Toolbar::UpdateFont() |
| 140 | { |
| 141 | static const WCHAR s_fontName[] = L"WebView2APISample Font"; |
| 142 | if (m_font) |
| 143 | { |
| 144 | DeleteObject(m_font); |
| 145 | } |
| 146 | LOGFONT logFont; |
| 147 | GetObject(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), &logFont); |
| 148 | double dpiScale = m_appWindow->GetDpiScale(); |
| 149 | double textScale = m_appWindow->GetTextScale(); |
| 150 | logFont.lfHeight *= LONG(dpiScale * textScale); |
| 151 | logFont.lfWidth *= LONG(dpiScale * textScale); |
| 152 | StringCchCopy(logFont.lfFaceName, ARRAYSIZE(logFont.lfFaceName), s_fontName); |
| 153 | m_font = CreateFontIndirect(&logFont); |
| 154 | } |
| 155 | |
| 156 | void Toolbar::SelectAll() |
| 157 | { |
nothing calls this directly
no test coverage detected