1 #include <OSD_FontAspect.hxx>
2 #include <InterfaceGraphic_tgl_all.hxx>
3 #include <OpenGl_tgl_all.hxx>
4 #include <InterfaceGraphic_telem.hxx>
5 #include <NCollection_DataMap.hxx>
6 #include <TCollection_AsciiString.hxx>
7 #include <TCollection_HAsciiString.hxx>
10 #define NUM_FONT_SIZES 40
11 #define NUM_CHAR_FONT 1024
14 class OpenGl_TextRender{
18 static OpenGl_TextRender* instance();
19 Tint FindFont ( Tchar*, OSD_FontAspect, Tfloat, Tfloat = 1. , Tfloat = 1.);
21 void StringSize( char *text, GLint *width, GLint *ascent, GLint *descent);
22 void RenderText( const Standard_Integer id, const char* text);
23 void RenderText( char*, GLuint, int, GLfloat, GLfloat, GLfloat );
24 void ExportText( char* str, char* fontname, GLfloat height, GLfloat angle, GLint alingment, GLfloat x, GLfloat y, GLfloat z, GLboolean is2d );
26 static void getGL2PSFontName(char *src_font, char *ps_font);
34 static int curTexFont ;
36 int alignmentforgl2ps(int Hmode, int Vmode);
43 OSD_FontAspect fontAspect;
50 float xsizes[NUM_FONT_SIZES];
54 FontMapNode searchFontInMap( Handle(TCollection_HAsciiString)& fontName );
56 static FontMapNode fontMap[];
57 static FontEntry fontEntry[];
60 OpenGl_TextRender( const OpenGl_TextRender& ){};
61 OpenGl_TextRender& operator = ( const OpenGl_TextRender&){ return *this;};
62 ~OpenGl_TextRender(){};
68 Standard_Integer FontHeight;
72 typedef NCollection_DataMap<Standard_Integer,OGLFont_Cache> FontCache;
74 Standard_Integer _CurrentFontId;
75 Standard_ShortReal _XCurrentScale,