Documentation de la bibliothèque MLV-3.1.0

MLV_text.h
Aller à la documentation de ce fichier.
1/*
2 * This file is part of the MLV Library.
3 *
4 * Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
5 *
6 *
7 * This Library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This Library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
31#ifndef __MLV__MLV_TEXT_H__
32#define __MLV__MLV_TEXT_H__
33
34#include "MLV_color.h"
35#include "MLV_image.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
49
61
73
77typedef struct _MLV_Font MLV_Font;
78
91MLV_Font* MLV_load_font( const char* file_font, int size );
92
99void MLV_free_font( MLV_Font* font );
100
109void MLV_get_size_of_text( const char *text, int *width, int *height, ... );
110
121 const char *text, int *width, int *height, const MLV_Font* font, ...
122);
123
135void MLV_draw_text( int x, int y, const char *text, MLV_Color color, ... );
136
148 int x, int y, const char *text, const MLV_Font* font, MLV_Color color, ...
149);
150
165 int x, int y, const char *text, MLV_Color color, MLV_Image* image, ...
166);
167
180 int x, int y, const char *text, const MLV_Font* font, MLV_Color color,
181 MLV_Image* image, ...
182);
183
206 int x, int y,
207 const char* message,
208 int sizeInterligne,
209 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
210 MLV_Text_justification text_justification, ...
211);
212
228 int x, int y,
229 const char* message,
230 int sizeInterligne,
231 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
232 MLV_Text_justification text_justification,
233 MLV_Image* image, ...
234);
235
251 const char* message,
252 int sizeInterligne,
253 int *result_width, int *result_height,
254 ...
255);
256
272 int x, int y,
273 const char* message,
274 const MLV_Font* font,
275 int sizeInterligne,
276 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
277 MLV_Text_justification text_justification, ...
278);
279
296 int x, int y,
297 const char* message,
298 const MLV_Font* font,
299 int sizeInterligne,
300 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
301 MLV_Text_justification text_justification,
302 MLV_Image* image, ...
303);
304
305
323 const char* message,
324 const MLV_Font* font,
325 int sizeInterligne,
326 int *result_width, int *result_height,
327 ...
328);
329
363 int x, int y,
364 int width, int height,
365 const char* message ,
366 int sizeInterligne,
367 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
368 MLV_Text_justification text_justification,
369 MLV_Horizontal_position horizontal_position,
370 MLV_Vertical_position vertical_position,
371 ...
372);
373
393 int x, int y,
394 int width, int height,
395 const char* message ,
396 int sizeInterligne,
397 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
398 MLV_Text_justification text_justification,
399 MLV_Horizontal_position horizontal_position,
400 MLV_Vertical_position vertical_position,
401 MLV_Image* image,
402 ...
403);
404
425 int x, int y,
426 int width, int height,
427 const char* message ,
428 const MLV_Font* font,
429 int sizeInterligne,
430 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
431 MLV_Text_justification text_justification,
432 MLV_Horizontal_position horizontal_position,
433 MLV_Vertical_position vertical_position,
434 ...
435);
436
458 int x, int y,
459 int width, int height,
460 const char* message ,
461 MLV_Font* font,
462 int sizeInterligne,
463 MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor,
464 MLV_Text_justification text_justification,
465 MLV_Horizontal_position horizontal_position,
466 MLV_Vertical_position vertical_position,
467 MLV_Image* image,
468 ...
469);
470
482char* MLV_convert_unicode_to_string( int unicode );
483
484#ifdef __cplusplus
485}
486#endif
487
488#endif
489
Uint32 MLV_Color
Définit un type couleur pour la bibliothèque MLV.
Definition MLV_color.h:54
Définit toutes les couleurs disponibles dans la bibliothèque MLV.
struct _MLV_Image MLV_Image
Définit le type Image dans la bibliothèque MLV.
Definition MLV_image.h:53
Ce fichier définit tous les prototypes concernant les fonctions permettant d'insérer des images.
void MLV_draw_text_box_with_font_on_image(int x, int y, int width, int height, const char *message, MLV_Font *font, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification, MLV_Horizontal_position horizontal_position, MLV_Vertical_position vertical_position, MLV_Image *image,...)
Même chose que la fonction MLV_draw_text_box_with_font() mis à part que le texte n'est pas dessinné d...
void MLV_get_size_of_text(const char *text, int *width, int *height,...)
Cette fonction calcule la taille du texte qui sera affiché sur l'écran à l'aide de la fonction MLV_dr...
void MLV_draw_text_box_on_image(int x, int y, int width, int height, const char *message, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification, MLV_Horizontal_position horizontal_position, MLV_Vertical_position vertical_position, MLV_Image *image,...)
Même chose que MLV_draw_text_box() mis à part que le texte n'est pas écrit directement sur l'écran,...
void MLV_draw_adapted_text_box_on_image(int x, int y, const char *message, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification, MLV_Image *image,...)
Même chose que MLV_draw_adapted_text_box() mis à part que le texte est rendu avec une fonte de caract...
int MLV_get_size_of_adapted_text_box_with_font(const char *message, const MLV_Font *font, int sizeInterligne, int *result_width, int *result_height,...)
Cette fonction calcule la taille de la boîte de texte qui serait obtenue si vous utilisez la fonction...
void MLV_draw_text(int x, int y, const char *text, MLV_Color color,...)
Imprime un texte donné à une position et une couleur données.
struct _MLV_Font MLV_Font
Definition MLV_text.h:77
void MLV_draw_text_box_with_font(int x, int y, int width, int height, const char *message, const MLV_Font *font, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification, MLV_Horizontal_position horizontal_position, MLV_Vertical_position vertical_position,...)
Même chose que la fonction MLV_draw_text_box() mis à part que le texte est rendu avec une fonte de ca...
MLV_Text_justification
Énumère les différents types de justification du texte.
Definition MLV_text.h:44
@ MLV_TEXT_RIGHT
Definition MLV_text.h:47
@ MLV_TEXT_CENTER
Definition MLV_text.h:45
@ MLV_TEXT_LEFT
Definition MLV_text.h:46
void MLV_draw_text_with_font_on_image(int x, int y, const char *text, const MLV_Font *font, MLV_Color color, MLV_Image *image,...)
Écrit du texte sur une image en utilisant une couleur et une fonte de caractères données en paramètre...
char * MLV_convert_unicode_to_string(int unicode)
Transforme un caractère en format unicode en chaîne de caractères compatible avec le codage local (co...
MLV_Font * MLV_load_font(const char *file_font, int size)
Cette fonction charge en mémoire une fonte de caractères de standard "TrueType" (fichiers ayant une e...
int MLV_get_size_of_adapted_text_box(const char *message, int sizeInterligne, int *result_width, int *result_height,...)
Cette fonction calcule la taille de la boîte de texte qui serait obtenue si vous utilisez la fonction...
void MLV_draw_adapted_text_box_with_font(int x, int y, const char *message, const MLV_Font *font, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification,...)
Même chose que MLV_draw_adapted_text_box() mis à part que le texte est rendu avec une fonte de caract...
void MLV_draw_text_with_font(int x, int y, const char *text, const MLV_Font *font, MLV_Color color,...)
Écrit du texte sur l'écran en utilisant une couleur et une fonte de caractères données en paramètres.
MLV_Vertical_position
Énumère les différents types de positions verticales du texte dans une boîte.
Definition MLV_text.h:65
@ MLV_VERTICAL_TOP
Definition MLV_text.h:68
@ MLV_VERTICAL_CENTER
Definition MLV_text.h:66
@ MLV_VERTICAL_BOTTOM
Definition MLV_text.h:70
void MLV_get_size_of_text_with_font(const char *text, int *width, int *height, const MLV_Font *font,...)
Cette fonction calcule la taille du texte qui sera affiché sur l'écran à l'aide de la fonction MLV_dr...
MLV_Horizontal_position
Énumère les différents types de position horizontale du texte dans une boîte.
Definition MLV_text.h:53
@ MLV_HORIZONTAL_RIGHT
Definition MLV_text.h:58
@ MLV_HORIZONTAL_LEFT
Definition MLV_text.h:56
@ MLV_HORIZONTAL_CENTER
Definition MLV_text.h:54
void MLV_draw_adapted_text_box(int x, int y, const char *message, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification,...)
Dessine une boîte contenant du texte.
void MLV_draw_text_on_image(int x, int y, const char *text, MLV_Color color, MLV_Image *image,...)
Écrit sur une image un texte donné à une position et une couleur données.
void MLV_free_font(MLV_Font *font)
Cette fonction libère la mémoire d'une fonte de caractères précédement chargée.
void MLV_draw_text_box(int x, int y, int width, int height, const char *message, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification, MLV_Horizontal_position horizontal_position, MLV_Vertical_position vertical_position,...)
Dessine une boîte de taille donnée par l'utilisateur et contenant un texte donné par l'utilisateur.
void MLV_draw_adapted_text_box_with_font_on_image(int x, int y, const char *message, const MLV_Font *font, int sizeInterligne, MLV_Color borderColor, MLV_Color textColor, MLV_Color backgroundColor, MLV_Text_justification text_justification, MLV_Image *image,...)
Même chose que MLV_draw_adapted_text_box_with_font() mis à part que le texte est rendu sur une image ...