怎么在VC中显示索引范围为1-200的字体(解决后我奉献所有的分有700多分) 1。enum所有的系统字体/2。根据返回创建字体;3。use it。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 The following example uses the EnumFontFamilies function to retrieve the number of available raster, vector, and TrueType font families. UINT uAlignPrev; int aFontCount[] = { 0, 0, 0 }; char szCount[8]; EnumFontFamilies(hdc, (LPCTSTR) NULL, (FONTENUMPROC) EnumFamCallBack, (LPARAM) aFontCount); uAlignPrev = SetTextAlign(hdc, TA_UPDATECP); MoveToEx(hdc, 10, 50, (LPPOINT)NULL); TextOut(hdc, 0, 0, "Number of raster fonts: ", 24); itoa(aFontCount[0], szCount, 10); TextOut(hdc, 0, 0, szCount, strlen(szCount)); MoveToEx(hdc, 10, 75, (LPPOINT)NULL); TextOut(hdc, 0, 0, "Number of vector fonts: ", 24); itoa(aFontCount[1], szCount, 10); TextOut(hdc, 0, 0, szCount, strlen(szCount)); MoveToEx(hdc, 10, 100, (LPPOINT)NULL); TextOut(hdc, 0, 0, "Number of TrueType fonts: ", 26); itoa(aFontCount[2], szCount, 10); TextOut(hdc, 0, 0, szCount, strlen(szCount)); SetTextAlign(hdc, uAlignPrev); BOOL CALLBACK EnumFamCallBack(LPLOGFONT lplf, LPNEWTEXTMETRIC lpntm, DWORD FontType, LPVOID aFontCount) { int far * aiFontCount = (int far *) aFontCount; // Record the number of raster, TrueType, and vector // fonts in the font-count array. if (FontType & RASTER_FONTTYPE) aiFontCount[0]++; else if (FontType & TRUETYPE_FONTTYPE) aiFontCount[2]++; else aiFontCount[1]++; if (aiFontCount[0] || aiFontCount[1] || aiFontCount[2]) return TRUE; else return FALSE; UNREFERENCED_PARAMETER( lplf ); UNREFERENCED_PARAMETER( lpntm ); } To:zhizhi() 你有源码吗,我是要枚举指定字体的所有元素 To:wpxs0303(纹坪秀士) 谢谢,但我的意思是想获得某一个字体的所有字符和其属性(通过其索引列出)例如(宋体 中所有字符) 用CRegKey读写注册表具体步骤 我没辙了,组播接收问题 高手和版主帮解决一下用CreatePipe()建立管道时的问题 铁道部今天不公开,京沪高速铁路----日军中标!(转帖) 怎么根据一个汉字得到这个汉字的拼音? 怎么得到一个进程的父进程的ID 为什么这个组合圆画不出来? Win32 编程难题 谁做过RAS(Remote Access Server)方面的东西,请留言! 我的socket发送与接收方案,请大家指点如何提高效率与增强准确性 求安装程序的源代码或提供source code相关连接也可. 关于ListCtrl的问题
int aFontCount[] = { 0, 0, 0 };
char szCount[8];
EnumFontFamilies(hdc, (LPCTSTR) NULL,
(FONTENUMPROC) EnumFamCallBack, (LPARAM) aFontCount);
uAlignPrev = SetTextAlign(hdc, TA_UPDATECP);
MoveToEx(hdc, 10, 50, (LPPOINT)NULL);
TextOut(hdc, 0, 0, "Number of raster fonts: ", 24);
itoa(aFontCount[0], szCount, 10);
TextOut(hdc, 0, 0, szCount, strlen(szCount));
MoveToEx(hdc, 10, 75, (LPPOINT)NULL);
TextOut(hdc, 0, 0, "Number of vector fonts: ", 24);
itoa(aFontCount[1], szCount, 10);
TextOut(hdc, 0, 0, szCount, strlen(szCount));
MoveToEx(hdc, 10, 100, (LPPOINT)NULL);
TextOut(hdc, 0, 0, "Number of TrueType fonts: ", 26);
itoa(aFontCount[2], szCount, 10);
TextOut(hdc, 0, 0, szCount, strlen(szCount));
SetTextAlign(hdc, uAlignPrev);
BOOL CALLBACK EnumFamCallBack(LPLOGFONT lplf, LPNEWTEXTMETRIC lpntm, DWORD FontType, LPVOID aFontCount)
{
int far * aiFontCount = (int far *) aFontCount;
// Record the number of raster, TrueType, and vector
// fonts in the font-count array.
if (FontType & RASTER_FONTTYPE)
aiFontCount[0]++;
else if (FontType & TRUETYPE_FONTTYPE)
aiFontCount[2]++;
else
aiFontCount[1]++;
if (aiFontCount[0] || aiFontCount[1] || aiFontCount[2])
return TRUE;
else
return FALSE;
UNREFERENCED_PARAMETER( lplf );
UNREFERENCED_PARAMETER( lpntm );
}
你有源码吗,我是要枚举指定字体的所有元素
谢谢,但我的意思是想获得某一个字体的所有字符和其属性(通过其索引列出)
例如(宋体 中所有字符)