libtthimage/Lib/t_t16x24.c

51 lines
1.3 KiB
C
Raw Normal View History

2022-06-26 22:55:56 +02:00
/*
Proggy de test pour les fontes 16x24 - new 4 mai 2007, a StEx.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../tthimage.h"
/*::------------------------------------------------------------------::*/
int essai_f1(char *tgasrc, char *tgadst, char *texte)
{
Image_Desc *img;
int foo;
RGBA encre, papier;
img = Image_TGA_alloc_load(tgasrc);
foo = Image_t16x24_txtload("16x24thin", NULL, 0);
encre.r = 0; encre.g = 255; encre.b = 100; encre.a = 255;
papier.r = 255; papier.b = 0; papier.g = 0; papier.a = 200;
foo = Image_t16x24_pltstr_1(img, texte, 2, 42, &papier, &encre, 0);
foo = Image_TGA_save(tgadst, img, 0);
return -1;
}
/*::------------------------------------------------------------------::*/
int main(int argc, char *argv[])
{
char *fichier;
int foo;
Image_Desc *image;
fprintf(stderr, "-------------- %s ------------\n", argv[0]);
foo = Image_t16x24_chars_map("16x24thin", "all16x24chars.tga", 0);
foo = Image_t16x24_chars_map("bigfont.txt", "all16X24chars.tga", 0);
fprintf(stderr, "--------------------------\n");
Image_print_error("Essai fonte 16x24", foo);
foo = essai_f1("pov.tga", "/tmp/aaaa_plop.tga", "0123456789");
if (foo) {
fprintf(stderr, " ---> %d\n", foo);
}
return 0;
}
/*::------------------------------------------------------------------::*/