Пример #1
0
void threaded_process_v2_t::refresh_title_font()
{
	LOGFONT lf;
	memset(&lf, 0, sizeof(LOGFONT));
	m_titlecolour = GetSysColor(COLOR_WINDOWTEXT);

	HTHEME thm_textstyle = IsThemeActive() && IsAppThemed() ? OpenThemeData(get_wnd(), L"TextStyle") : NULL;
	if (thm_textstyle)
	{
		if (SUCCEEDED(GetThemeFont(thm_textstyle, NULL, TEXT_MAININSTRUCTION, 0, TMT_FONT, &lf)))
		{
			m_titlefont = CreateFontIndirect(&lf);
			GetThemeColor(thm_textstyle, TEXT_MAININSTRUCTION, NULL, TMT_TEXTCOLOR, &m_titlecolour);
		}
		CloseThemeData(thm_textstyle);
	}

	if (!m_titlefont.is_valid())
	{
		uGetIconFont(&lf);
		lf.lfWeight = FW_BOLD;
		m_titlefont = CreateFontIndirect(&lf);
	}

	m_titlefont_height = uGetFontHeight(m_titlefont);
}
Пример #2
0
	virtual void get_font(const cui::fonts::font_type_t p_type, LOGFONT & p_out) const
	{
		fonts_manager_data::entry_ptr_t p_entry;
		if (p_type == cui::fonts::font_type_items)
			p_entry = g_fonts_manager_data.m_common_items_entry;
		else
			p_entry = g_fonts_manager_data.m_common_labels_entry;

		if (p_entry->font_mode == cui::fonts::font_mode_system)
		{
			if (p_type == cui::fonts::font_type_items)
				uGetIconFont(&p_out);
			else
				uGetMenuFont(&p_out);
		}
		else
		{
			p_out = p_entry->font;
		}
	}