text

text — Enables capabilities to write some text on rendering screen.

Synopsis

void                (*VisuGlTextFunc)                   (const gchar *text,
                                                         VisuGlTextSize size);
enum                VisuGlTextSize;
void                visu_gl_text_drawChars              (gchar *s,
                                                         VisuGlTextSize size);
void                visu_gl_text_initFontList           ();
void                visu_gl_text_onNewContext           ();
void                visu_gl_text_putTextWithFTGL        (const gchar *text,
                                                         VisuGlTextSize size);
void                visu_gl_text_rebuildFontList        ();
gboolean            visu_gl_text_setFontSize            (float size);
gboolean            visu_gl_text_setFunc                (VisuGlTextFunc func);

Description

For the moment, this module is very basic and the only fonts available is the helvetica 12 one. This module is currently broken under Windows.

Details

VisuGlTextFunc ()

void                (*VisuGlTextFunc)                   (const gchar *text,
                                                         VisuGlTextSize size);

A function that render iso8859-1 text at the current raster position.

text :

the text to render.

size :

the size for rendering.

Since 3.7


enum VisuGlTextSize

typedef enum {
    VISU_GL_TEXT_NORMAL,
    VISU_GL_TEXT_SMALL
} VisuGlTextSize;

Different text size available in V_Sim.

VISU_GL_TEXT_NORMAL

normal size (14) ;

VISU_GL_TEXT_SMALL

small text (12).

visu_gl_text_drawChars ()

void                visu_gl_text_drawChars              (gchar *s,
                                                         VisuGlTextSize size);

Draw the given string on the current raster position with default font.

s :

a string.

size :

the size of the text to render.

visu_gl_text_initFontList ()

void                visu_gl_text_initFontList           ();

Initialise the font drawing with default font (depending on system). It must be called before visu_gl_text_drawChars() and not in a glNewList(). Can be called several times, fonts are initialized once only. Use visu_gl_text_rebuildFontList() to force to build a new font list.


visu_gl_text_onNewContext ()

void                visu_gl_text_onNewContext           ();

Set the flag for text list build to FALSE. It will force to rebuild the text lists at next call of visu_gl_text_initFontList().

Since 3.6


visu_gl_text_putTextWithFTGL ()

void                visu_gl_text_putTextWithFTGL        (const gchar *text,
                                                         VisuGlTextSize size);

A VisuGlTextFunc routine using FTGL to render text with Pixmap lists, see visu_gl_text_setFunc().

text :

the text to write.

size :

the size.

Since 3.7


visu_gl_text_rebuildFontList ()

void                visu_gl_text_rebuildFontList        ();

Force to buid a new font list (for example new context has changed.


visu_gl_text_setFontSize ()

gboolean            visu_gl_text_setFontSize            (float size);

Change the normal font size used by V_Sim (see VISU_GL_TEXT_NORMAL). The small font is scaled accordingly. This is working only with the FTGL backend.

size :

a new size.

Returns :

TRUE if font size is indeed changed.

Since 3.7


visu_gl_text_setFunc ()

gboolean            visu_gl_text_setFunc                (VisuGlTextFunc func);

Set the function to render text at the raster position.

func :

a VisuGlTextFunc function. [scope call][allow-none]

Returns :

TRUE if the function is indeed changed.

Since 3.7