现在的位置: 首页 > 综合 > 正文

GetGlyphIndicesA

2014年09月05日 ⁄ 综合 ⁄ 共 372字 ⁄ 字号 评论关闭

函数功能:该函数将一个字符串转为字形下标的数组。此函数可用来确定一种字体里是否存在某个字形

控制台下代码:

#include "stdafx.h"
#include <windows.h>
#include"stdio.h"
void main()
{
 char ch[] = {'0'};
 WORD chnl[20] = {0};
 HDC hdc; 
 hdc = GetWindowDC(0);
 int n = GetGlyphIndicesA(hdc,ch,1,chnl,0X0001);

///或者#define GS_8BIT_INDICES     0x00000001

//#define GGI_MARK_NONEXISTING_GLYPHS  0X0001

 system("pause");
}

返回值:如果函数调用成功,返回转换的字符数;如果函数调用失败,返回值是GDI_ERROR。

抱歉!评论已关闭.