00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00031 #ifndef __MLV_TEXT_H__
00032 #define __MLV_TEXT_H__
00033
00034 #include "MLV_color.h"
00035 #include "MLV_image.h"
00036
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040
00044 typedef enum {
00045 MLV_TEXT_CENTER,
00046 MLV_TEXT_LEFT,
00047 MLV_TEXT_RIGHT
00048 } MLV_Text_justification;
00049
00053 typedef enum {
00054 MLV_HORIZONTAL_CENTER,
00056 MLV_HORIZONTAL_LEFT,
00058 MLV_HORIZONTAL_RIGHT
00060 } MLV_Horizontal_position;
00061
00065 typedef enum {
00066 MLV_VERTICAL_CENTER,
00068 MLV_VERTICAL_TOP,
00070 MLV_VERTICAL_BOTTOM
00072 } MLV_Vertical_position;
00073
00077 typedef struct _MLV_Font MLV_Font;
00078
00090 MLV_Font* MLV_load_font( const char* file_font, int size );
00091
00096 void MLV_free_font( MLV_Font* font );
00097
00106 void MLV_get_size_of_text( const char *text, int *width, int *height );
00107
00118 void MLV_get_size_of_text_with_font(
00119 const char *text, int *width, int *height, MLV_Font* font
00120 );
00121
00133 void MLV_draw_text(int x, int y, const char *text, MLV_Color color);
00134
00145 void MLV_draw_text_with_font(
00146 int x, int y, const char *text, MLV_Font* font, MLV_Color color
00147 );
00148
00162 void MLV_draw_text_on_image(
00163 int x, int y, const char *text, MLV_Color color, MLV_Image* image
00164 );
00165
00177 void MLV_draw_text_with_font_on_image(
00178 int x, int y, const char *text, MLV_Font* font, MLV_Color color,
00179 MLV_Image* image
00180 );
00181
00203 void MLV_draw_adapted_text_box(
00204 int x, int y,
00205 const char* message,
00206 int sizeInterligne,
00207 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00208 MLV_Text_justification text_justification
00209 );
00210
00225 void MLV_draw_adapted_text_box_on_image(
00226 int x, int y,
00227 const char* message,
00228 int sizeInterligne,
00229 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00230 MLV_Text_justification text_justification,
00231 MLV_Image* image
00232 );
00233
00246 int MLV_get_size_of_adapted_text_box(
00247 const char* message,
00248 int sizeInterligne,
00249 int *result_width, int *result_height
00250 );
00251
00266 void MLV_draw_adapted_text_box_with_font(
00267 int x, int y,
00268 const char* message,
00269 MLV_Font* font,
00270 int sizeInterligne,
00271 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00272 MLV_Text_justification text_justification
00273 );
00274
00290 void MLV_draw_adapted_text_box_with_font_on_image(
00291 int x, int y,
00292 const char* message,
00293 MLV_Font* font,
00294 int sizeInterligne,
00295 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00296 MLV_Text_justification text_justification,
00297 MLV_Image* image
00298 );
00299
00300
00314 int MLV_get_size_of_adapted_text_box_with_font(
00315 const char* message,
00316 MLV_Font* font,
00317 int sizeInterligne,
00318 int *result_width, int *result_height
00319 );
00320
00353 void MLV_draw_text_box(
00354 int x, int y,
00355 int width, int height,
00356 const char* message ,
00357 int sizeInterligne,
00358 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00359 MLV_Text_justification text_justification,
00360 MLV_Horizontal_position horizontal_position,
00361 MLV_Vertical_position vertical_position
00362 );
00363
00382 void MLV_draw_text_box_on_image(
00383 int x, int y,
00384 int width, int height,
00385 const char* message ,
00386 int sizeInterligne,
00387 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00388 MLV_Text_justification text_justification,
00389 MLV_Horizontal_position horizontal_position,
00390 MLV_Vertical_position vertical_position,
00391 MLV_Image* image
00392 );
00393
00413 void MLV_draw_text_box_with_font(
00414 int x, int y,
00415 int width, int height,
00416 const char* message ,
00417 MLV_Font* font,
00418 int sizeInterligne,
00419 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00420 MLV_Text_justification text_justification,
00421 MLV_Horizontal_position horizontal_position,
00422 MLV_Vertical_position vertical_position
00423 );
00424
00445 void MLV_draw_text_box_with_font_on_image(
00446 int x, int y,
00447 int width, int height,
00448 const char* message ,
00449 MLV_Font* font,
00450 int sizeInterligne,
00451 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
00452 MLV_Text_justification text_justification,
00453 MLV_Horizontal_position horizontal_position,
00454 MLV_Vertical_position vertical_position,
00455 MLV_Image* image
00456 );
00457
00466 char* MLV_convert_unicode_to_string( int unicode );
00467
00468 #ifdef __cplusplus
00469 }
00470 #endif
00471
00472 #endif
00473