23 unsigned char character,
unsigned int sx,
26 int helper = character * 8;
28 int top_left_pixel_x = sx + col * (8);
29 int top_left_pixel_y = sy + row * (8);
32 for (y = 0; y < 8; ++y)
34 for (x = 0; x < 8; ++x)
38 if (font_entry & 1 << (7 - x))
39 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
42 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
51 unsigned char character,
unsigned int sx,
54 int helper = character * 7 * 5;
56 int top_left_pixel_x = sx + col * (5);
57 int top_left_pixel_y = sy + row * (7);
60 for (y = 0; y < 7; ++y)
62 for (x = 0; x < 5; ++x)
66 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
69 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
78 unsigned char character,
unsigned int sx,
81 int helper = character * 6 * 4;
83 int top_left_pixel_x = sx + col * (4);
84 int top_left_pixel_y = sy + row * (6);
87 for (y = 0; y < 6; ++y)
89 for (x = 0; x < 4; ++x)
93 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
96 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
105 int size,
unsigned int sx,
unsigned int sy)
109 for (i; stringOut[i] != NULL; ++i)
155 FT_Done_Face (canvas->
ttf_face[face_num][0]);
163 FT_New_Face (canvas->
ftLib, fontname, 0, &canvas->
ttf_face[face_num][0]);
171 && FT_IS_SCALABLE (canvas->
ttf_face[face_num][0]))
173 FT_Set_Char_Size (canvas->
ttf_face[face_num][0], 0,
182 if (!FT_IS_SCALABLE (face))
183 ttf_fontsize = face->available_sizes->height;
185 y += ttf_fontsize * .75;
193 FT_GlyphSlot slot = face->glyph;
196 unsigned int len = strlen (str);
199 for (i = 0; i < len; i++)
201 glyph_index = FT_Get_Char_Index (face, str[i]);
202 errcode = FT_Load_Glyph (face, glyph_index, 0);
203 width += slot->advance.x >> 6;
234 unsigned char character,
int x,
int y,
int color)
236 FT_Int char_x, char_y, p, q;
237 FT_Int x_max = x + charbitmap.width;
238 FT_Int y_max = y + charbitmap.rows;
239 static FT_Bitmap tmpbuffer;
242 FT_Bitmap_Convert (canvas->
ftLib, &charbitmap, &tmpbuffer, 1);
244 for (char_y = y, q = 0; char_y < y_max; char_y++, q++)
245 for (char_x = x, p = 0; char_x < x_max; char_x++, p++)
246 if (tmpbuffer.buffer[q * tmpbuffer.width + p])
254 FT_GlyphSlot slot = face->glyph;
256 unsigned int len = strlen (str);
258 for (i = 0; i < len; i++)
261 FT_Load_Char (face, str[i],
262 FT_LOAD_RENDER | FT_LOAD_MONOCHROME |
263 FT_LOAD_TARGET_MONO);
264 draw_ttf_char (canvas, slot->bitmap, str[i], x + slot->bitmap_left,
265 y - slot->bitmap_top, color);
266 x += slot->advance.x >> 6;
284 int color,
int center,
char *print_string)
290 if (fontsize > 0 && FT_IS_SCALABLE (canvas->
ttf_face[face_num][0]))
294 FT_Set_Pixel_Sizes (canvas->
ttf_face[face_num][0], 0,
297 printf (
"Trouble setting the Glyph size!\n");
304 else if (center == 2)