函数原型:
BOOL wglUseFontOutlines(
HDC hdc, // device context of the outline font
DWORD first, // first glyph to be turned into a display list
DWORD count, // number of glyphs to be turned into display lists
DWORD listBase, // specifies the starting display list
FLOAT deviation, // specifies the maximum chordal deviation from the true outlines
FLOAT extrusion, // extrusion value in the negative z direction
int format, // specifies line segments or polygons in display lists
LPGLYPHMETRICSFLOAT lpgmf // address of buffer to receive glyph metric data
);
函数功能描述:
可以用于创建三维的字体。只需要修改FLOAT extrusion变量的值就可以控制。
函数参数说明:
HDC hdc, // 字体的设备上下文
DWORD first, //要转换为显示列表的第一个字符
DWORD count, // 要转化为显示列表字符的个数
DWORD listBase, //显示列表的基数
FLOAT deviation, //指定与实际轮廓的最大偏移量
FLOAT extrusion, // 指定字体在Z轴负方向的值。通过修改这个值就可以显示3D字符。
int format, //指定显示列表线段或多边形
LPGLYPHMETRICSFLOAT lpgmf //接受字符的地址
几个重要重要参数的说明:
deviation 用于标示字体的显示质量,默认为0.0值越小显示效果越好。
extrusion 有两个不同取值 WGL_FONT_LINES 和WGL_FONT_POLYGONS。他们标示三维立体字符
的填充方式,一种使用直线来绘制三维字体,一种使用多边形来进行绘制。
lpgmf 用于保存创建字体的一些信息,通常lpgmf 指向的空间长度是不小于创建的显示列表数的。
应用举例:
创建一个基值为listBase从字符ASCII 32到127的96个显示列表。字形信息保存到agmf指向的数值中。字符的宽度为0.15
GLYPHMETRICSFLOAT agmf[96];
wglUseFontOutlines(hDC, 32, 96, listBase,0.0,0.15,WGL_FONT_LINES,agmf);