Ejemplo n.º 1
0
//--------------------------------------------------------------------------//
//--------------------------------------------------------------------------//
void CFontList::CheckDefaultFont()
{
	int nFonts = m_FontArray.size();
	for (int i = 0; i < nFonts; i++)
	{
		if (lstrcmp(m_FontArray[i].lf.lfFaceName, DEFAULT_FONT) == 0)
			break;
	}

	if (i >= nFonts)
	{
		HGLOBAL hResFont = NULL;
		HRSRC	hResource;

		if ((hResource = ::FindResource(_Module.GetResourceInstance(),
		  MAKEINTRESOURCE(IDR_CACFC), "TTZ")) != NULL)
		{
			hResFont = ::LoadResource(_Module.GetResourceInstance(),
			  hResource);
		}

		if (hResFont)
		{
			BYTE *pCompressedBytes = (BYTE *) ::LockResource(hResFont);
			DWORD dwCompressedLen = ::SizeofResource(_Module.GetResourceInstance(),
			  hResource);
			InstallFont(pCompressedBytes, dwCompressedLen, DEFAULT_FONT,
			  DEFAULT_FONTFILE);
		}
	}
}
Ejemplo n.º 2
0
void
SetFontPosition (DviWidget dw, int position,
		 const char *dvi_name, const char *extra)
{
	char	*x_name;

	x_name = MapDviNameToXName (dw, dvi_name);
	if (x_name)
		(void) InstallFont (dw, position, dvi_name, x_name);

	extra = extra;		/* unused; suppress compiler warning */
}
Ejemplo n.º 3
0
bool CFontInstaller::InstallFont(const CAtlArray<BYTE>& data)
{
	return InstallFont(data.GetData(), (UINT)data.GetCount());
}