本文整理汇总了C++中FTFont::Depth方法的典型用法代码示例。如果您正苦于以下问题:C++ FTFont::Depth方法的具体用法?C++ FTFont::Depth怎么用?C++ FTFont::Depth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTFont
的用法示例。
在下文中一共展示了FTFont::Depth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glPixelStorei
MOboolean
moFont::Init( moFontType p_Type, moText p_fontname, MOint p_size, MOuint glid ) {
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
switch( (int)p_Type ) {
case MO_FONT_OUTLINE://3d
m_pFace = (FTFont*)new FTGLOutlineFont( p_fontname );
break;
case MO_FONT_TRANSLUCENT://2d
m_pFace = (FTFont*)new FTGLBitmapFont( p_fontname );
break;
case MO_FONT_TRANSLUCENTTEXTURE://3d
m_pFace = (FTFont*)new FTGLTextureFont( p_fontname );
break;
case MO_FONT_GRAYSCALE://2d
m_pFace = (FTFont*)new FTGLPixmapFont( p_fontname );
break;
case MO_FONT_MONOCHROME://2d
m_pFace = (FTFont*)new FTGLPixmapFont( p_fontname );
break;
case MO_FONT_SOLID://3d extruded (depth)
m_pFace = (FTFont*)new FTGLExtrdFont( p_fontname );
break;
case MO_FONT_FILLED://3d
m_pFace = (FTFont*)new FTGLPolygonFont( p_fontname );
break;
case MO_FONT_GLBUILD:
m_FontGLId = glid;
BuildFont();
break;
case MO_FONT_UNDEFINED:
MODebug2->Error(moText(" FontManager:: UNDEFINED font type"));
m_pFace = NULL;
break;
}
FTFont* FF = (FTFont*) m_pFace;
FT_Error FontError;
if (FF)
FontError = FF->Error();
if ( ( p_Type!=MO_FONT_GLBUILD && ( FF == NULL || FontError!=0 ) ) ||
( p_Type==MO_FONT_UNDEFINED ) || (p_Type==MO_FONT_GLBUILD && (int)m_FontGLId==-1)) {
MODebug2->Error(moText("FontManager: Could not construct face from ")+(moText)p_fontname);
return false;
} else {
m_Name = p_fontname;
if (FF) {
SetSize(p_size);
FF->Depth(20);
//FF->CharMap(ft_encoding_unicode);
}
return true;
}
return false;
}
示例2: AudicleFTGLFont
AudicleFTGLFont( char * name ) {
glEnable ( GL_TEXTURE_2D );
char fontlocation[512];
strncpy ( fontlocation, fontpath, 512 );
strncat ( fontlocation, name, 512 - strlen ( fontlocation ) );
m_font = new FTGLTextureFont ( fontlocation );
if ( m_font->Error() ) {
fprintf(stderr, "AudicleFTGLFont: font load error %d - exiting\n", m_font->Error() );
exit(1);
}
else {
if ( !m_font->FaceSize(18) ) {
fprintf(stderr, "AudicleFTGLFont: font size error %d - exiting\n", m_font->Error() );
exit(1);
}
m_name = name;
m_font->Depth(2);
m_font->CharMap(ft_encoding_unicode);
glDisable ( GL_TEXTURE_2D );
float x1, y1, z1, x2, y2, z2;
m_font->BBox( samplestring , x1, y1, z1, x2, y2, z2);
m_height = y2;
m_line_height = m_font->LineHeight();
m_height_unit_scale = 1.0 / m_height ;
m_line_unit_scale = 1.0 / m_line_height ;
m_mono_width = m_height;
}
}