fgLineList HUD_StippleLineList;
fntRenderer *HUDtext = 0;
-float HUD_TextSize = 0;
+fntTexFont *HUD_Font = 0;
+float HUD_TextSize = 0;
int HUD_style = 0;
float HUD_matrix[16];
delete tmp;
}
-// HUD_TextSize = fgGetInt("/sim/startup/xsize") / 60;
- HUD_TextSize = 10;
+ FGFontCache *fc = globals->get_fontcache();
+ HUD_Font = fc->getTexFont(fgGetString("/sim/hud/font/name", "Helvetica.txf"));
+ HUD_TextSize = fgGetFloat("/sim/hud/font/size", 10);
+
HUDtext = new fntRenderer();
- HUDtext -> setFont ( guiFntHandle ) ;
- HUDtext -> setPointSize ( HUD_TextSize ) ;
+ HUDtext->setFont(HUD_Font);
+ HUDtext->setPointSize(HUD_TextSize);
HUD_TextList.setFont( HUDtext );
return 0; // For now. Later we may use this for an error code.
#define USE_HUD_TextList
+extern fntTexFont *HUD_Font;
extern float HUD_TextSize;
extern fntRenderer *HUDtext;
extern float HUD_matrix[16];
{
if ( HUDtext && str ) {
float r, l ;
- guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
+ HUD_Font->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
return FloatToInt( r - l );
}
return 0 ;
{
if ( HUDtext && strlen( msg )) {
float r, l ;
- guiFntHandle->getBBox ( msg, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
+ HUD_Font->getBBox ( msg, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
return FloatToInt( r - l );
}
return 0 ;
i++;
}
if(c>p) {
- fnt->setPointSize(8);
+ fnt->setPointSize(HUD_TextSize * 0.8);
int p1=c-3;
char *tmp1=msg+p1;
int p2=p1*8;
fnt->start2f(x+p2,y);
fnt->puts(tmp1);
- fnt->setPointSize(12);
+ fnt->setPointSize(HUD_TextSize * 1.2);
char tmp2[64];
strncpy(tmp2,msg,p1);
tmp2[p1]='\0';
fnt->start2f(x,y);
fnt->puts(tmp2);
} else {
- fnt->setPointSize(12);
+ fnt->setPointSize(HUD_TextSize * 1.2);
fnt->start2f( x, y );
fnt->puts(tmp);
}
} else {
//if digits not equal to 1
- fnt->setPointSize(8);
+ fnt->setPointSize(HUD_TextSize * 0.8);
fnt->start2f( x, y );
fnt->puts( msg ) ;
}
{
if ( HUDtext && str ) {
float r, l ;
- guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
+ HUD_Font->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
return FloatToInt( r - l );
}
return 0 ;