Index: proj/libs/graph/include/font.h
===================================================================
--- proj/libs/graph/include/font.h	(revision 313)
+++ proj/libs/graph/include/font.h	(revision 314)
@@ -1,42 +1,41 @@
 #ifndef FONT_H_INCLUDED
 #define FONT_H_INCLUDED
 
-enum text_valign{
+struct font;
+typedef struct font font_t;
+font_t* (font_ctor)(const char *s);
+int     (font_dtor)(font_t *p);
+
+int (font_init)(void);
+const font_t* font_get_default(void);
+const font_t* font_get_consolas(void);
+int (font_free)(void);
+
+typedef enum{
     text_valign_top    = -1,
     text_valign_center =  0,
     text_valign_bottom =  1
-};
+} text_valign;
 
-enum text_halign{
+typedef enum{
     text_halign_left   = -1,
     text_halign_center =  0,
     text_halign_right  =  1
-};
+} text_halign;
 
-struct font;
-typedef struct font font_t;
-font_t* (font_ctor)(const char *s);
-int     (font_dtor)(font_t *p);
-
-font_t *consolas;
-font_t *default_font;
-
-int (font_init)(void);
-int (font_free)(void);
-
 struct text;
 typedef struct text text_t;
 text_t* (text_ctor)(const font_t *fnt, const char *txt);
 void    (text_dtor)(text_t *p);
 char* (text_get_string)(const text_t *p);
-void (text_set_text)  (text_t *p, const char *txt);
+void (text_set_string)(text_t *p, const char *txt);
 void (text_set_pos)   (text_t *p, int16_t x, int16_t y);
 void (text_set_size)  (text_t *p, unsigned size);
 void (text_set_color) (text_t *p, uint32_t color);
-void (text_set_valign)(text_t *p, enum text_valign valign);
-void (text_set_halign)(text_t *p, enum text_halign halign);
+void (text_set_valign)(text_t *p, text_valign valign);
+void (text_set_halign)(text_t *p, text_halign halign);
 int16_t (text_get_x)  (const text_t *p);
 int16_t (text_get_y)  (const text_t *p);
-int (text_draw)     (const text_t *p);
+int     (text_draw)   (const text_t *p);
 
 #endif //FONT_H_INCLUDED
Index: proj/libs/graph/src/font.c
===================================================================
--- proj/libs/graph/src/font.c	(revision 313)
+++ proj/libs/graph/src/font.c	(revision 314)
@@ -8,6 +8,7 @@
 #include "errors.h"
 #include <assert.h>
 
+/// GLYPH
 struct glyph{
     uint16_t w, h;
     uint8_t *map;
@@ -55,11 +56,11 @@
     return SUCCESS;
 }
 
+/// FONT
 struct font{
     size_t nchars;
     glyph_t **glyphs;
 };
-
 font_t* (font_ctor)(const char *s){
     font_t *ret = malloc(sizeof(font_t));
     if(ret == NULL) return NULL;
@@ -93,8 +94,8 @@
     return SUCCESS;
 }
 
-font_t *consolas = NULL;
-font_t *default_font = NULL;
+static font_t *consolas     = NULL;
+static font_t *default_font = NULL;
 
 int (font_init)(void){
     consolas = font_ctor("/home/lcom/labs/proj/media/font/Consolas/xpm2");
@@ -102,6 +103,8 @@
     default_font = consolas;
     return SUCCESS;
 }
+const font_t* font_get_default(void){ return default_font; }
+const font_t* font_get_consolas(void){ return consolas; }
 int (font_free)(void){
     int r;
     if((r = font_dtor(consolas))) return r;
@@ -110,6 +113,7 @@
     return SUCCESS;
 }
 
+/// TEXT
 struct text{
     const font_t *fnt;
     char *txt;
@@ -116,8 +120,8 @@
     int16_t x, y;
     int size;
     uint32_t color;
-    enum text_valign valign;
-    enum text_halign halign;
+    text_valign valign;
+    text_halign halign;
 };
 text_t* (text_ctor)(const font_t *fnt, const char *txt){
     if(fnt == NULL) return NULL;
@@ -125,7 +129,7 @@
     if(ret == NULL) return NULL;
     ret->fnt = fnt;
     ret->txt = NULL;
-    text_set_text(ret, txt);
+    text_set_string(ret, txt);
     ret->x = 0;
     ret->y = 0;
     ret->size = 25;
@@ -139,7 +143,7 @@
     free(p->txt);
     free(p);
 }
-void (text_set_text) (text_t *p, const char *txt){
+void (text_set_string) (text_t *p, const char *txt){
     size_t sz = strlen(txt);
     p->txt = realloc(p->txt, (sz+1)*sizeof(char));
     if(p->txt == NULL) return;
@@ -146,11 +150,11 @@
     strcpy(p->txt, txt);
 }
 char* (text_get_string)(const text_t *p){return p->txt; }
-void (text_set_pos)   (text_t *p, int16_t x, int16_t y   ){ p->x = x; p->y = y; }
-void (text_set_size)  (text_t *p, unsigned size          ){ p->size = size    ; }
-void (text_set_color) (text_t *p, uint32_t color         ){ p->color = color  ; }
-void (text_set_valign)(text_t *p, enum text_valign valign){ p->valign = valign; }
-void (text_set_halign)(text_t *p, enum text_halign halign){ p->halign = halign; }
+void (text_set_pos)   (text_t *p, int16_t x, int16_t y){ p->x = x; p->y = y; }
+void (text_set_size)  (text_t *p, unsigned size       ){ p->size = size    ; }
+void (text_set_color) (text_t *p, uint32_t color      ){ p->color = color  ; }
+void (text_set_valign)(text_t *p, text_valign valign  ){ p->valign = valign; }
+void (text_set_halign)(text_t *p, text_halign halign  ){ p->halign = halign; }
 int16_t (text_get_x)  (const text_t *p){ return p->x; }
 int16_t (text_get_y)  (const text_t *p){ return p->y; }
 
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(revision 313)
+++ proj/src/ent.c	(revision 314)
@@ -28,6 +28,7 @@
     sprite_t *dude;
     sprite_t *weapon;
     double health, current_health;
+    rectangle_t *green_bar, *red_bar;
     text_t *txt;
     gunner_type type;
     int team;
@@ -41,15 +42,19 @@
     ret->y = 0.0;
     ret->health = 100;
     ret->current_health = ret->health;
-    ret->txt = text_ctor(default_font, "");
+    ret->green_bar = rectangle_ctor(0,0,0,0);
+    ret->red_bar   = rectangle_ctor(0,0,0,0);
+    ret->txt = text_ctor(font_get_default(), "");
     ret->type = type;
     ret->team = team;
     ret->dude   = sprite_ctor(dude  );
     ret->weapon = sprite_ctor(weapon);
-    if(ret->dude == NULL || ret->weapon == NULL){
+    if(ret->txt == NULL || ret->dude == NULL || ret->weapon == NULL || ret->green_bar == NULL || ret->red_bar == NULL){
         gunner_dtor(ret);
         return NULL;
     }
+    rectangle_set_fill_color(ret->green_bar, GREEN_HEALTH_COLOR);
+    rectangle_set_fill_color(ret->red_bar  , GRAPH_RED         );
     text_set_size(ret->txt, 15);
     text_set_valign(ret->txt, text_valign_center);
     text_set_halign(ret->txt, text_halign_center);
@@ -60,6 +65,8 @@
     if(p == NULL) return;
     sprite_dtor(p->dude);
     sprite_dtor(p->weapon);
+    rectangle_dtor(p->green_bar);
+    rectangle_dtor(p->red_bar);
     text_dtor(p->txt);
     free(p);
 }
@@ -99,7 +106,6 @@
     sprite_draw     (p->dude  );
     gunner_draw_health(p);
 }
-
 void (gunner_draw_health)(const gunner_t *p) {
     int16_t w = sprite_get_w(p->dude);
     int16_t h = sprite_get_h(p->dude);
@@ -108,19 +114,14 @@
     double curr_health = gunner_get_curr_health(p);
     double health = gunner_get_health(p);
     double perc = curr_health/health;
-    rectangle_t *green_bar = rectangle_ctor(x, y, (int16_t)(w*perc), 10);
-    rectangle_set_fill_color(green_bar, GREEN_HEALTH_COLOR);
-    rectangle_t *red_bar = rectangle_ctor(x+(int16_t)(w*perc), y, (int16_t)(w*(1-perc)), 10);
-    rectangle_set_fill_color(red_bar, GRAPH_RED);
+    rectangle_set_pos(p->green_bar, x, y); rectangle_set_size(p->green_bar, (int16_t)(w*perc), 10);
+    rectangle_set_pos(p->red_bar, x+(int16_t)(w*perc), y); rectangle_set_size(p->red_bar, (int16_t)(w*(1-perc)), 10);
     char buf[20]; sprintf(buf, "%d/%d", (int)p->current_health, (int)p->health);
-    text_set_text(p->txt, buf);
+    text_set_string(p->txt, buf);
     text_set_pos(p->txt, x+w/2, y+10/2);
-    rectangle_draw(green_bar);
-    rectangle_draw(red_bar);
+    rectangle_draw(p->green_bar);
+    rectangle_draw(p->red_bar);
     text_draw(p->txt);
-    rectangle_dtor(green_bar);
-    rectangle_dtor(red_bar);
-
 }
 
 double (gunner_distance)(const gunner_t *p1, const gunner_t *p2){
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 313)
+++ proj/src/proj.c	(revision 314)
@@ -80,7 +80,7 @@
     /// Load stuff
     {
         graph_clear_screen();
-        text_t *txt = text_ctor(default_font, "Loading...");
+        text_t *txt = text_ctor(font_get_default(), "Loading...");
         text_set_pos(txt, graph_get_XRes()/2, graph_get_YRes()/2);
         text_set_valign(txt, text_valign_center);
         text_set_halign(txt, text_halign_center);
@@ -100,7 +100,7 @@
         sp_crosshair = sprite_ctor(bsp_crosshair); if(sp_crosshair == NULL) printf("Failed to get crosshair sprite\n");
     }
 
-    menu_t *main_menu = menu_ctor(default_font);
+    menu_t *main_menu = menu_ctor(font_get_default());
     menu_add_item(main_menu, "Single player");
     menu_add_item(main_menu, "Multiplayer");
     menu_add_item(main_menu, "Chat");
@@ -205,7 +205,7 @@
 static int (multiplayer)(void) {
     int r;
 
-    menu_t *main_menu = menu_ctor(default_font);
+    menu_t *main_menu = menu_ctor(font_get_default());
     menu_add_item(main_menu, "Create");
     menu_add_item(main_menu, "Connect");
     menu_add_item(main_menu, "Back");
@@ -270,7 +270,7 @@
     nctp_set_processor(multiplayer_process);/*
 
     ent_set_scale(DEFAULT_SCALE);
-    text_timer_t *in_game_timer = timer_ctor(default_font);
+    text_timer_t *in_game_timer = timer_ctor(font_get_default());
 
     list_t *shooter_list = list_ctor();
 
@@ -334,7 +334,7 @@
     nctp_set_processor(multiplayer_process);
 
     ent_set_scale(DEFAULT_SCALE);
-    text_timer_t *in_game_timer = timer_ctor(default_font);
+    text_timer_t *in_game_timer = timer_ctor(font_get_default());
 
     list_t *shooter_list = list_ctor();
 
@@ -398,7 +398,7 @@
 
     int r;
 
-    menu_t *main_menu = menu_ctor(default_font);
+    menu_t *main_menu = menu_ctor(font_get_default());
     menu_add_item(main_menu, "Campaign");
     menu_add_item(main_menu, "Zombies");
     menu_add_item(main_menu, "Back");
@@ -462,7 +462,7 @@
     int r;
 
     ent_set_scale(DEFAULT_SCALE);
-    text_timer_t *in_game_timer = timer_ctor(default_font);
+    text_timer_t *in_game_timer = timer_ctor(font_get_default());
 
     list_t *shooter_list = list_ctor();
 
@@ -570,7 +570,7 @@
     int r;
 
     ent_set_scale(DEFAULT_SCALE);
-    text_timer_t *in_game_timer = timer_ctor(default_font);
+    text_timer_t *in_game_timer = timer_ctor(font_get_default());
 
     list_t *shooter_list = list_ctor();
 
@@ -715,8 +715,8 @@
         strcpy(buffer2, dest);
         strncat(buffer2, " <", 2);
         for(size_t i = CHAT_MAX_NUM-1; i; --i)
-        text_set_text(t_text[i], text_get_string(t_text[i-1]));
-        text_set_text(t_text[0], buffer2);
+        text_set_string(t_text[i], text_get_string(t_text[i-1]));
+        text_set_string(t_text[0], buffer2);
         for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
             if(text_get_string(t_text[i])[0] == '>'){
                 text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
@@ -749,7 +749,7 @@
         rectangle_set_fill_trans(r_buffer, GRAPH_TRANSPARENT);
     }
     text_t      *t_buffer = NULL; {
-        t_buffer = text_ctor(default_font, "");
+        t_buffer = text_ctor(font_get_default(), "");
         text_set_pos(t_buffer, rectangle_get_x(r_buffer)+50,
         rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)/2);
         text_set_halign(t_buffer, text_halign_left);
@@ -757,7 +757,7 @@
         text_set_color (t_buffer, TEXT_COLOR);
     }
     text_t      *t_size   = NULL; {
-        t_size = text_ctor(default_font, "");
+        t_size = text_ctor(font_get_default(), "");
         text_set_pos(t_size, rectangle_get_x(r_buffer)+rectangle_get_w(r_buffer)-5,
         rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)-5);
         text_set_halign(t_size, text_halign_right);
@@ -766,7 +766,7 @@
         text_set_size  (t_size, 18);
         char buffer2[20];
         sprintf(buffer2, "%d/%d", strlen(buffer), CHAT_MAX_SIZE);
-        text_set_text(t_size, buffer2);
+        text_set_string(t_size, buffer2);
     }
 
     /** r_text */ {
@@ -780,7 +780,7 @@
     }
     /** t_text */ {
     for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
-        t_text[i] = text_ctor(default_font, " ");
+        t_text[i] = text_ctor(font_get_default(), " ");
         text_set_pos(t_text[i], rectangle_get_x(r_text)+50,
         rectangle_get_y(r_text)+rectangle_get_h(r_text)-30-25*i);
         text_set_halign(t_text[i], text_halign_left);
@@ -820,8 +820,8 @@
                     char buffer2[CHAT_MAX_SIZE+3] = "> ";
                     strncat(buffer2, buffer, strlen(buffer));
                     for(size_t i = CHAT_MAX_NUM-1; i; --i)
-                    text_set_text(t_text[i], text_get_string(t_text[i-1]));
-                    text_set_text(t_text[0], buffer2);
+                    text_set_string(t_text[i], text_get_string(t_text[i-1]));
+                    text_set_string(t_text[0], buffer2);
                     for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
                         if(text_get_string(t_text[i])[0] == '>'){
                             text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
@@ -840,10 +840,10 @@
                     if(strlen(buffer) < CHAT_MAX_SIZE) strncat(buffer, &c, 1);
                     else                               printf("Char limit exceeded\n");
                 }
-                text_set_text(t_buffer, buffer);
+                text_set_string(t_buffer, buffer);
                 char buffer2[20];
                 sprintf(buffer2, "%d/%d", strlen(buffer), CHAT_MAX_SIZE);
-                text_set_text(t_size, buffer2);
+                text_set_string(t_size, buffer2);
                 case MOUSE_IRQ:
                 if (counter_mouse_ih >= 3) {
                     mouse_parse_packet(packet_mouse_ih, &pp);
