libg15render
|
#include "libg15render.h"
Go to the source code of this file.
Functions | |
int | calc_ttf_centering (FT_Face face, char *str) |
int | calc_ttf_right_justify (FT_Face face, char *str) |
int | calc_ttf_totalstringwidth (FT_Face face, char *str) |
int | calc_ttf_true_ypos (FT_Face face, int y, int ttf_fontsize) |
void | draw_ttf_char (g15canvas *canvas, FT_Bitmap charbitmap, unsigned char character, int x, int y, int color) |
void | draw_ttf_str (g15canvas *canvas, char *str, int x, int y, int color, FT_Face face) |
void | g15r_renderCharacterLarge (g15canvas *canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy) |
Renders a character in the large font at (x, y) | |
void | g15r_renderCharacterMedium (g15canvas *canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy) |
Renders a character in the meduim font at (x, y) | |
void | g15r_renderCharacterSmall (g15canvas *canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy) |
Renders a character in the small font at (x, y) | |
void | g15r_renderString (g15canvas *canvas, unsigned char stringOut[], int row, int size, unsigned int sx, unsigned int sy) |
Renders a string with font size in row. | |
void | g15r_ttfLoad (g15canvas *canvas, char *fontname, int fontsize, int face_num) |
Loads a font through the FreeType2 library. | |
void | g15r_ttfPrint (g15canvas *canvas, int x, int y, int fontsize, int face_num, int color, int center, char *print_string) |
Prints a string in a given font. | |
int calc_ttf_centering | ( | FT_Face | face, |
char * | str | ||
) |
Definition at line 209 of file text.c.
References calc_ttf_totalstringwidth().
Referenced by g15r_ttfPrint().
int calc_ttf_right_justify | ( | FT_Face | face, |
char * | str | ||
) |
Definition at line 221 of file text.c.
References calc_ttf_totalstringwidth().
Referenced by g15r_ttfPrint().
int calc_ttf_totalstringwidth | ( | FT_Face | face, |
char * | str | ||
) |
Definition at line 191 of file text.c.
Referenced by calc_ttf_centering(), and calc_ttf_right_justify().
int calc_ttf_true_ypos | ( | FT_Face | face, |
int | y, | ||
int | ttf_fontsize | ||
) |
Definition at line 179 of file text.c.
Referenced by g15r_ttfPrint().
void draw_ttf_char | ( | g15canvas * | canvas, |
FT_Bitmap | charbitmap, | ||
unsigned char | character, | ||
int | x, | ||
int | y, | ||
int | color | ||
) |
Definition at line 233 of file text.c.
References g15canvas::ftLib, and g15r_setPixel().
Referenced by draw_ttf_str().
void draw_ttf_str | ( | g15canvas * | canvas, |
char * | str, | ||
int | x, | ||
int | y, | ||
int | color, | ||
FT_Face | face | ||
) |
Definition at line 251 of file text.c.
References draw_ttf_char().
Referenced by g15r_ttfPrint().
void g15r_renderCharacterLarge | ( | g15canvas * | canvas, |
int | col, | ||
int | row, | ||
unsigned char | character, | ||
unsigned int | sx, | ||
unsigned int | sy | ||
) |
Renders a character in the large font at (x, y)
Definition at line 22 of file text.c.
References fontdata_8x8, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
Referenced by g15r_renderString().
void g15r_renderCharacterMedium | ( | g15canvas * | canvas, |
int | col, | ||
int | row, | ||
unsigned char | character, | ||
unsigned int | sx, | ||
unsigned int | sy | ||
) |
Renders a character in the meduim font at (x, y)
Definition at line 50 of file text.c.
References fontdata_7x5, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
Referenced by g15r_renderString().
void g15r_renderCharacterSmall | ( | g15canvas * | canvas, |
int | col, | ||
int | row, | ||
unsigned char | character, | ||
unsigned int | sx, | ||
unsigned int | sy | ||
) |
Renders a character in the small font at (x, y)
Definition at line 77 of file text.c.
References fontdata_6x4, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
Referenced by g15r_renderString().
void g15r_renderString | ( | g15canvas * | canvas, |
unsigned char | stringOut[], | ||
int | row, | ||
int | size, | ||
unsigned int | sx, | ||
unsigned int | sy | ||
) |
Renders a string with font size in row.
Definition at line 104 of file text.c.
References G15_TEXT_LARGE, G15_TEXT_MED, G15_TEXT_SMALL, g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
void g15r_ttfLoad | ( | g15canvas * | canvas, |
char * | fontname, | ||
int | fontsize, | ||
int | face_num | ||
) |
Loads a font through the FreeType2 library.
Load a font for use with FreeType2 font support
canvas | A pointer to a g15canvas struct in which the buffer to be operated on is found. |
fontname | Absolute pathname to font file to be loaded. |
fontsize | Size in points for font to be loaded. |
face_num | Slot into which font face will be loaded. |
Definition at line 145 of file text.c.
References g15canvas::ftLib, G15_MAX_FACE, g15canvas::ttf_face, and g15canvas::ttf_fontsize.
void g15r_ttfPrint | ( | g15canvas * | canvas, |
int | x, | ||
int | y, | ||
int | fontsize, | ||
int | face_num, | ||
int | color, | ||
int | center, | ||
char * | print_string | ||
) |
Prints a string in a given font.
Render a string with a FreeType2 font
canvas | A pointer to a g15canvas struct in which the buffer to be operated on is found. |
x | initial x position for string. |
y | initial y position for string. |
fontsize | Size of string in points. |
face_num | Font to be used is loaded in this slot. |
color | Text will be drawn this color. |
center | Text will be centered if center == 1 and right justified if center == 2. |
print_string | Pointer to the string to be printed. |
Definition at line 283 of file text.c.
References calc_ttf_centering(), calc_ttf_right_justify(), calc_ttf_true_ypos(), draw_ttf_str(), g15canvas::ttf_face, and g15canvas::ttf_fontsize.