[Plib-users] fntTexFont Problem.
                
                Brought to you by:
                
                    sjbaker
                    
                
            
            
        
        
        
    | 
      
      
      From: Allen Y. <ay...@wr...> - 2003-04-01 20:22:59
      
     | 
| Hi,
I tried to create 3D texts on the screen. I wanted to use fntTexFont to
solve my problem. However, my code kept crashing on Creating a new
fntTexFont object. The problem was that fntTexFont can't find .txf file in
my directory. However, I already created a sub_directory under my project
and the .txf file was in there. I really want to know where I should put
those .txf files and how can I make this thing work? I will be appreciated
any help. This is my code:
 
static fntTexFont **font_list ;
static const char *font_names [] =
{
            "Times-Roman.txf"
};
 
COpenGLFonts::COpenGLFonts()
{
            textout = new fntRenderer();
 
            TextOut();
 
}
 
COpenGLFonts::~COpenGLFonts()
{
 
}
 
void COpenGLFonts::TextOut()
{
            static fntRenderer *textout;
            char fname [ 256 ] ;
 
            font_list = new fntTexFont* [ sizeof(font_names) /
sizeof(font_names[0]) ] ;
 
            sprintf ( fname, "fnt/%s", font_names [0] ) ;
 
            font_list [0] = new fntTexFont ( fname ) ;  //crash here every
time!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
            fntTexFont times("Times_Roman.txf");
 
 
            textout -> setFont      ( ×) ;
            textout -> setPointSize ( 25.0f ) ;
 
            textout->begin();
               glColor3f ( 1.0f, 1.0f, 0.0f ) ;
                        textout->start2f(50.0f,80.0f);
                        textout->puts("hello");
            textout->end();
 
}
 
 
 |