本文整理汇总了C++中FontStyle::getFontName方法的典型用法代码示例。如果您正苦于以下问题:C++ FontStyle::getFontName方法的具体用法?C++ FontStyle::getFontName怎么用?C++ FontStyle::getFontName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontStyle
的用法示例。
在下文中一共展示了FontStyle::getFontName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// Initialize GLUT & OpenSG and set up the scene
int main(int argc, char **argv)
{
cout << "Testing screen aligned text generation and file-IO." << endl;
if(argc == 1)
{
FFATAL(("Need *.txf or *.ttf font file\n"));
return -1;
}
// OSG init
osgInit(argc, argv);
// GLUT init
int winid = setupGLUT(&argc, argv);
// the connection between GLUT and OpenSG
GLUTWindowPtr gwin = GLUTWindow::create();
gwin->setId(winid);
gwin->init();
PathHandler paths;
paths.push_backPath(".");
//paths.push_backPath("/home/elmi/wrk/development/texFont");
// create the scene
FontStyle *fontStyle = FontStyleFactory::the().create( paths, argv[1],
0.25);
cout << fontStyle->getFontName() << endl;
// create the scene
NodePtr pTorus = makeTorus( 0.02, 0.55, 16, 16);
ChunkMaterialPtr mat = ChunkMaterial::create();
MaterialChunkPtr pmc = MaterialChunk::create();
pmc->setDiffuse( Color4f( 1,0,0,0.5 ) );
pmc->setAmbient( Color4f( 0,1,0,0.5 ) );
pmc->setSpecular( Color4f( 0,0,1,0.5 ) );
pmc->setLit( true );
pmc->setShininess( 20 );
beginEditCP(mat);
{
mat->addChunk( pmc );
}
endEditCP(mat);
scene = Node::create();
GroupPtr group = Group::create();
beginEditCP( scene );
{
scene->setCore( group );
}
endEditCP( scene );
SharedFontStylePtr sfs = SharedFontStyle::create();
sfs->setContainedFontStyle( fontStyle );
for( int x=0; x<100; x += 20 )
{
for( int y=0; y<100; y += 20 )
{
for( int z=0; z<100; z += 20 )
{
ScreenAlignedTextPtr scaText = ScreenAlignedText::create();
if( scaText == NullFC )
{
exit (2);
}
SharedFontStyleWrapperPtr pFSWrapper = SharedFontStyleWrapper::create();
pFSWrapper->setFStyleContainer( sfs );
ostringstream cString;
cString << '('
<< x
<< ','
<< y
<< ','
<< z
<< ')'
<< endl;
beginEditCP(scaText);
{
scaText->setPosition( Vec3f ( x, y, z ) );
scaText->setFont( pFSWrapper );
scaText->setVerticalLineDistance( 0.20 );
scaText->setAlignment( 0 );
scaText->editMFText()->push_back( cString.str() );
scaText->setMaterial( mat );
}
endEditCP(scaText);
NodePtr pTextNode = Node::create();
beginEditCP( pTextNode );
{
pTextNode->setCore( scaText );
}
beginEditCP( scene );
{
//.........这里部分代码省略.........