I want to add new font and draw text on the screen.
...... 我用这个字体来起草案文,正文为阿里文。
I don t know the reason.
这里是我的法典。
请见并帮助我。
HANDLE hFind;
WIN32_FIND_DATA wfd;
WCHAR szFontPath[MAX_PATH];
int nNum;
swprintf(szFontPath, L"%s\Fonts\*.*", m_szAppPath);
hFind = FindFirstFile(szFontPath, &wfd);
if(hFind == INVALID_HANDLE_VALUE)
return;
do
{
if(wfd.cFileName[0] == L . )
continue;
swprintf(szFontPath, L"%s\Fonts\%s", m_szAppPath, wfd.cFileName);
nNum = AddFontResource(szFontPath);
}
while(FindNextFile(hFind, &wfd));
PostMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
FindClose(hFind);
页: 1 其他参考资料
int nHeight;
LPDIRECT3DSURFACE9 pSurface;
HDC hDC;
m_pDevice = pDevice;
m_pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pSurface);
pSurface->GetDC(&hDC);
nHeight = -MulDiv( dwSize, GetDeviceCaps(hDC, LOGPIXELSY), 72 );
pSurface->ReleaseDC(hDC);
m_hFont = CreateFont( nHeight, 0, 0, 0, bBold, bItalic, false, false,
HANGUL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
DEFAULT_PITCH/* | FF_DONTCARE*/, L"Helvetica-Condensed-Black-Se");
pSurface->Release();