1 /***********************************************************
2 * Artsoft Retro-Game Library *
3 *----------------------------------------------------------*
4 * (c) 1994-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
21 /* ========================================================================= */
23 /* ========================================================================= */
25 void InitFontInfo(struct FontBitmapInfo *font_bitmap_info, int num_fonts,
26 int (*select_font_function)(int),
27 int (*get_font_from_token_function)(char *))
29 gfx.num_fonts = num_fonts;
30 gfx.font_bitmap_info = font_bitmap_info;
31 gfx.select_font_function = select_font_function;
32 gfx.get_font_from_token_function = get_font_from_token_function;
35 void FreeFontInfo(struct FontBitmapInfo *font_bitmap_info)
37 if (font_bitmap_info == NULL)
40 free(font_bitmap_info);
43 struct FontBitmapInfo *getFontBitmapInfo(int font_nr)
45 int font_bitmap_id = gfx.select_font_function(font_nr);
47 return &gfx.font_bitmap_info[font_bitmap_id];
50 int getFontWidth(int font_nr)
52 int font_bitmap_id = gfx.select_font_function(font_nr);
54 return gfx.font_bitmap_info[font_bitmap_id].width;
57 int getFontHeight(int font_nr)
59 int font_bitmap_id = gfx.select_font_function(font_nr);
61 return gfx.font_bitmap_info[font_bitmap_id].height;
64 int getTextWidth(char *text, int font_nr)
66 return (text != NULL ? strlen(text) * getFontWidth(font_nr) : 0);
69 static int getFontCharPosition(int font_nr, char c)
71 int font_bitmap_id = gfx.select_font_function(font_nr);
72 struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
73 boolean default_font = (font->num_chars == DEFAULT_NUM_CHARS_PER_FONT);
74 int font_pos = (unsigned char)c - 32;
76 /* map some special characters to their ascii values in default font */
78 font_pos = MAP_FONT_ASCII(c) - 32;
80 /* this allows dynamic special characters together with special font */
81 if (font_pos < 0 || font_pos >= font->num_chars)
87 void getFontCharSource(int font_nr, char c, Bitmap **bitmap, int *x, int *y)
89 int font_bitmap_id = gfx.select_font_function(font_nr);
90 struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
91 int font_pos = getFontCharPosition(font_nr, c);
93 *bitmap = font->bitmap;
94 *x = font->src_x + (font_pos % font->num_chars_per_line) * font->width;
95 *y = font->src_y + (font_pos / font->num_chars_per_line) * font->height;
99 /* ========================================================================= */
100 /* text string helper functions */
101 /* ========================================================================= */
103 int maxWordLengthInString(char *text)
106 int word_len = 0, max_word_len = 0;
108 for (text_ptr = text; *text_ptr; text_ptr++)
110 word_len = (*text_ptr != ' ' ? word_len + 1 : 0);
112 max_word_len = MAX(word_len, max_word_len);
119 /* ========================================================================= */
120 /* simple text drawing functions */
121 /* ========================================================================= */
123 void DrawInitTextExt(char *text, int ypos, int font_nr, boolean force)
127 static unsigned int progress_delay = 0;
128 unsigned int progress_delay_value = 100; /* (in milliseconds) */
131 // LimitScreenUpdates(TRUE); // (ignore "force" for now)
132 // LimitScreenUpdates(!force);
133 LimitScreenUpdates(TRUE);
138 if (!force && !DelayReached(&progress_delay, progress_delay_value))
142 if (window != NULL &&
143 gfx.draw_init_text &&
145 gfx.font_bitmap_info[font_nr].bitmap != NULL)
147 int x = (video.width - getTextWidth(text, font_nr)) / 2;
149 int width = video.width;
150 int height = getFontHeight(font_nr);
152 ClearRectangle(drawto, 0, y, width, height);
153 DrawTextExt(drawto, x, y, text, font_nr, BLIT_OPAQUE);
155 BlitBitmap(drawto, window, 0, 0, video.width, video.height, 0, 0);
158 static unsigned int progress_delay = 0;
159 unsigned int progress_delay_value = 100; /* (in milliseconds) */
161 // LimitScreenUpdates(TRUE); // (ignore "force" for now)
162 LimitScreenUpdates(!force);
166 if (!force && !DelayReached(&progress_delay, progress_delay_value))
169 if (window != NULL &&
170 gfx.draw_init_text &&
172 gfx.font_bitmap_info[font_nr].bitmap != NULL)
174 int x = (video.width - getTextWidth(text, font_nr)) / 2;
176 int width = video.width;
177 int height = getFontHeight(font_nr);
179 ClearRectangle(drawto, 0, y, width, height);
180 DrawTextExt(drawto, x, y, text, font_nr, BLIT_OPAQUE);
182 /* this makes things significantly faster than directly drawing to window */
183 BlitBitmap(drawto, window, 0, y, width, height, 0, y);
188 void DrawInitText(char *text, int ypos, int font_nr)
190 // DrawInitTextExt(text, ypos, font_nr, TRUE);
191 DrawInitTextExt(text, ypos, font_nr, FALSE);
194 void DrawInitTextAlways(char *text, int ypos, int font_nr)
196 DrawInitTextExt(text, ypos, font_nr, TRUE);
199 void DrawInitTextIfNeeded(char *text, int ypos, int font_nr)
201 DrawInitTextExt(text, ypos, font_nr, FALSE);
204 void DrawTextF(int x, int y, int font_nr, char *format, ...)
206 char buffer[MAX_OUTPUT_LINESIZE + 1];
209 va_start(ap, format);
210 vsprintf(buffer, format, ap);
213 if (strlen(buffer) > MAX_OUTPUT_LINESIZE)
214 Error(ERR_EXIT, "string too long in DrawTextF() -- aborting");
216 DrawText(gfx.sx + x, gfx.sy + y, buffer, font_nr);
219 void DrawTextFCentered(int y, int font_nr, char *format, ...)
221 char buffer[MAX_OUTPUT_LINESIZE + 1];
224 va_start(ap, format);
225 vsprintf(buffer, format, ap);
228 if (strlen(buffer) > MAX_OUTPUT_LINESIZE)
229 Error(ERR_EXIT, "string too long in DrawTextFCentered() -- aborting");
231 DrawText(gfx.sx + (gfx.sxsize - getTextWidth(buffer, font_nr)) / 2,
232 gfx.sy + y, buffer, font_nr);
235 void DrawTextS(int x, int y, int font_nr, char *text)
237 DrawText(gfx.sx + x, gfx.sy + y, text, font_nr);
240 void DrawTextSCentered(int y, int font_nr, char *text)
242 DrawText(gfx.sx + (gfx.sxsize - getTextWidth(text, font_nr)) / 2,
243 gfx.sy + y, text, font_nr);
246 void DrawTextCentered(int y, int font_nr, char *text)
248 DrawText((gfx.sxsize - getTextWidth(text, font_nr)) / 2, y, text, font_nr);
251 void DrawTextSAligned(int x, int y, char *text, int font_nr, int align)
253 DrawText(gfx.sx + ALIGNED_XPOS(x, getTextWidth(text, font_nr), align),
254 gfx.sx + y, text, font_nr);
257 void DrawTextAligned(int x, int y, char *text, int font_nr, int align)
259 DrawText(ALIGNED_XPOS(x, getTextWidth(text, font_nr), align),
263 void DrawText(int x, int y, char *text, int font_nr)
265 int mask_mode = BLIT_OPAQUE;
267 if (DrawingOnBackground(x, y))
268 mask_mode = BLIT_ON_BACKGROUND;
270 DrawTextExt(drawto, x, y, text, font_nr, mask_mode);
273 if (IN_GFX_FIELD_FULL(x, y))
274 redraw_mask |= REDRAW_FIELD;
275 else if (IN_GFX_DOOR_1(x, y))
276 redraw_mask |= REDRAW_DOOR_1;
277 else if (IN_GFX_DOOR_2(x, y))
278 redraw_mask |= REDRAW_DOOR_2;
279 else if (IN_GFX_DOOR_3(x, y))
280 redraw_mask |= REDRAW_DOOR_3;
282 redraw_mask |= REDRAW_ALL;
285 redraw_mask |= REDRAW_FIELD;
286 else if (y < gfx.vy || gfx.vy == 0)
287 redraw_mask |= REDRAW_DOOR_1;
291 void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text,
292 int font_nr, int mask_mode)
295 struct FontBitmapInfo *font = getFontBitmapInfo(font_nr);
297 int font_bitmap_id = gfx.select_font_function(font_nr);
298 struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
300 int font_width = getFontWidth(font_nr);
301 int font_height = getFontHeight(font_nr);
303 int border_1 = gfx.sx + gfx.sxsize;
304 int border_2 = gfx.dx + gfx.dxsize;
305 int dst_x_start = dst_x;
309 char *text_ptr = text;
311 if (font->bitmap == NULL)
314 /* skip text to be printed outside the window (left/right will be clipped) */
315 if (dst_y < 0 || dst_y + font_height > video.height)
318 /* add offset for drawing font characters */
319 dst_x += font->draw_xoffset;
320 dst_y += font->draw_yoffset;
324 char c = *text_ptr++;
327 c = ' '; /* print space instead of newline */
329 getFontCharSource(font_nr, c, &src_bitmap, &src_x, &src_y);
331 /* clip text at the left side of the window */
339 /* clip text at the right side of the window */
341 if (dst_x + font_width > video.width)
344 /* (this does not work well when trying to print text to whole screen) */
345 if ((dst_x_start < border_1 && dst_x + font_width > border_1) ||
346 (dst_x_start < border_2 && dst_x + font_width > border_2))
350 if (mask_mode == BLIT_INVERSE) /* special mode for text gadgets */
352 /* first step: draw solid colored rectangle (use "cursor" character) */
353 if (strlen(text) == 1) /* only one char inverted => draw cursor */
355 Bitmap *cursor_bitmap;
356 int cursor_x, cursor_y;
358 getFontCharSource(font_nr, FONT_ASCII_CURSOR, &cursor_bitmap,
359 &cursor_x, &cursor_y);
361 BlitBitmap(cursor_bitmap, dst_bitmap, cursor_x, cursor_y,
362 font_width, font_height, dst_x, dst_y);
365 #if defined(TARGET_SDL)
366 /* second step: draw masked inverted character */
367 SDLCopyInverseMasked(src_bitmap, dst_bitmap, src_x, src_y,
368 font_width, font_height, dst_x, dst_y);
370 /* second step: draw masked black rectangle (use "space" character) */
371 SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc,
372 dst_x - src_x, dst_y - src_y);
373 BlitBitmapMasked(src_bitmap, dst_bitmap, 0, 0,
374 font_width, font_height, dst_x, dst_y);
377 else if (mask_mode == BLIT_MASKED || mask_mode == BLIT_ON_BACKGROUND)
379 if (mask_mode == BLIT_ON_BACKGROUND)
381 /* clear font character background */
382 ClearRectangleOnBackground(dst_bitmap, dst_x, dst_y,
383 font_width, font_height);
386 SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc,
387 dst_x - src_x, dst_y - src_y);
389 BlitBitmapMasked(src_bitmap, dst_bitmap, src_x, src_y,
390 font_width, font_height, dst_x, dst_y);
392 else /* normal, non-masked font blitting */
394 BlitBitmap(src_bitmap, dst_bitmap, src_x, src_y,
395 font_width, font_height, dst_x, dst_y);
403 /* ========================================================================= */
404 /* text buffer drawing functions */
405 /* ========================================================================= */
407 #define MAX_LINES_FROM_FILE 1024
411 char *GetTextBufferFromFile(char *filename, int max_lines)
417 if (filename == NULL)
420 if (!(file = openFile(filename, MODE_READ)))
423 buffer = checked_calloc(1); /* start with valid, but empty text buffer */
425 while (!checkEndOfFile(file) && num_lines < max_lines)
427 char line[MAX_LINE_LEN];
429 /* read next line of input file */
430 if (!getStringFromFile(file, line, MAX_LINE_LEN))
433 buffer = checked_realloc(buffer, strlen(buffer) + strlen(line) + 1);
435 strcat(buffer, line);
447 char *GetTextBufferFromFile(char *filename, int max_lines)
453 if (filename == NULL)
456 if (!(file = fopen(filename, MODE_READ)))
459 buffer = checked_calloc(1); /* start with valid, but empty text buffer */
461 while (!feof(file) && num_lines < max_lines)
463 char line[MAX_LINE_LEN];
465 /* read next line of input file */
466 if (!fgets(line, MAX_LINE_LEN, file))
469 buffer = checked_realloc(buffer, strlen(buffer) + strlen(line) + 1);
471 strcat(buffer, line);
483 void DrawTextToTextArea_OLD(int x, int y, char *text, int font_nr, int line_length,
484 int area_xsize, int area_ysize, int mask_mode)
487 int font_height = getFontHeight(font_nr);
492 while (*text && area_line < area_ysize)
494 char buffer[MAX_OUTPUT_LINESIZE + 1];
497 for (i = 0; i < line_length && *text; i++)
498 if ((buffer[i] = *text++) == '\n')
500 buffer[MIN(i, area_xsize)] = '\0';
502 DrawTextExt(drawto, x, y + area_line * font_height, buffer, font_nr,
508 redraw_mask |= REDRAW_FIELD;
511 static boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer,
512 int *dst_buffer_len, int line_length,
513 boolean last_line_was_empty)
515 char *text_ptr = *src_buffer_ptr;
516 char *buffer = dst_buffer;
517 int buffer_len = *dst_buffer_len;
518 boolean buffer_filled = FALSE;
525 /* skip leading whitespaces */
526 while (*text_ptr == ' ' || *text_ptr == '\t')
532 /* look for end of next word */
533 while (*word_ptr != ' ' && *word_ptr != '\t' && *word_ptr != '\0')
543 else if (*text_ptr == '\n') /* special case: force empty line */
548 /* prevent printing of multiple empty lines */
549 if (buffer_len > 0 || !last_line_was_empty)
550 buffer_filled = TRUE;
552 else if (word_len < line_length - buffer_len)
554 /* word fits into text buffer -- add word */
557 buffer[buffer_len++] = ' ';
559 strncpy(&buffer[buffer_len], text_ptr, word_len);
560 buffer_len += word_len;
561 buffer[buffer_len] = '\0';
562 text_ptr += word_len;
564 else if (buffer_len > 0)
566 /* not enough space left for word in text buffer -- print buffer */
568 buffer_filled = TRUE;
572 /* word does not fit at all into empty text buffer -- cut word */
574 strncpy(buffer, text_ptr, line_length);
575 buffer[line_length] = '\0';
576 text_ptr += line_length;
577 buffer_filled = TRUE;
584 *src_buffer_ptr = text_ptr;
585 *dst_buffer_len = buffer_len;
587 return buffer_filled;
591 void DrawTextWrapped_OLD(int x, int y, char *text, int font_nr, int line_length,
594 char *text_ptr = text;
595 int current_line = 0;
596 int font_height = getFontHeight(font_nr);
598 while (*text_ptr && current_line < max_lines)
600 char buffer[line_length + 1];
605 RenderLineToBuffer(&text_ptr, buffer, &buffer_len, line_length, TRUE);
607 DrawText(x, y + current_line * font_height, buffer, font_nr);
614 int DrawTextFromFile_OLD(int x, int y, char *filename, int font_nr,
615 int line_length, int max_lines, boolean wrap_text)
617 int font_height = getFontHeight(font_nr);
618 char line[MAX_LINE_LEN];
619 char buffer[line_length + 1];
621 int current_line = 0;
624 if (current_line >= max_lines)
627 if (filename == NULL)
630 if (!(file = fopen(filename, MODE_READ)))
636 while (!feof(file) && current_line < max_lines)
639 boolean last_line_was_empty = TRUE;
641 /* read next line of input file */
642 if (!fgets(line, MAX_LINE_LEN, file))
645 /* skip comments (lines directly beginning with '#') */
649 /* cut trailing newline from input line */
650 for (line_ptr = line; *line_ptr; line_ptr++)
652 if (*line_ptr == '\n' || *line_ptr == '\r')
659 if (strlen(line) == 0) /* special case: force empty line */
664 while (*line_ptr && current_line < max_lines)
667 boolean buffer_filled;
671 buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len,
672 line_length, last_line_was_empty);
676 if (strlen(line_ptr) <= line_length)
678 buffer_len = strlen(line_ptr);
679 strcpy(buffer, line_ptr);
683 buffer_len = line_length;
684 strncpy(buffer, line_ptr, line_length);
687 buffer[buffer_len] = '\0';
688 line_ptr += buffer_len;
690 buffer_filled = TRUE;
693 boolean buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len,
694 line_length, last_line_was_empty);
699 DrawText(x, y + current_line * font_height, buffer, font_nr);
702 last_line_was_empty = (buffer_len == 0);
712 if (buffer_len > 0 && current_line < max_lines)
714 DrawText(x, y + current_line * font_height, buffer, font_nr);
722 static boolean getCheckedTokenValueFromString(char *string, char **token,
727 if (!getTokenValueFromString(string, token, value))
730 if (**token != '.') /* token should begin with dot */
733 for (ptr = *token; *ptr; ptr++) /* token should contain no whitespace */
734 if (*ptr == ' ' || *ptr == '\t')
737 for (ptr = *value; *ptr; ptr++) /* value should contain no whitespace */
738 if (*ptr == ' ' || *ptr == '\t')
744 static void DrawTextBuffer_Flush(int x, int y, char *buffer, int font_nr,
745 int line_length, int cut_length,
746 int line_spacing, int mask_mode,
747 boolean centered, int current_line)
749 int buffer_len = strlen(buffer);
750 int font_width = getFontWidth(font_nr);
751 int font_height = getFontHeight(font_nr);
752 int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0);
754 (centered ? font_width * (line_length - buffer_len) / 2 : 0);
755 int final_cut_length = MAX(0, cut_length - offset_chars);
756 int xx = x + offset_xsize;
757 int yy = y + current_line * (font_height + line_spacing);
759 buffer[final_cut_length] = '\0';
762 DrawTextExt(drawto, xx, yy, buffer, font_nr, mask_mode);
764 DrawText(xx, yy, buffer, font_nr);
767 int DrawTextBuffer(int x, int y, char *text_buffer, int font_nr,
768 int line_length, int cut_length, int max_lines,
769 int line_spacing, int mask_mode, boolean autowrap,
770 boolean centered, boolean parse_comments)
773 int font_width = getFontWidth(font_nr);
774 int font_height = getFontHeight(font_nr);
776 char buffer[line_length + 1];
778 int current_line = 0;
780 if (text_buffer == NULL || *text_buffer == '\0')
783 if (current_line >= max_lines)
786 if (cut_length == -1)
787 cut_length = line_length;
792 while (*text_buffer && current_line < max_lines)
794 char line[MAX_LINE_LEN + 1];
796 boolean last_line_was_empty = TRUE;
798 int num_line_chars = MAX_LINE_LEN;
800 int num_line_chars = (autowrap ? MAX_LINE_LEN : line_length);
804 /* copy next line from text buffer to line buffer (nearly fgets() style) */
805 for (i = 0; i < num_line_chars && *text_buffer; i++)
806 if ((line[i] = *text_buffer++) == '\n')
810 /* prevent 'num_line_chars' sized lines to cause additional empty line */
811 if (i == num_line_chars && *text_buffer == '\n')
814 /* skip comments (lines directly beginning with '#') */
815 if (line[0] == '#' && parse_comments)
819 /* try to read generic token/value pair definition after comment sign */
820 if (getCheckedTokenValueFromString(line + 1, &token, &value))
822 /* if found, flush the current buffer, if non-empty */
823 if (buffer_len > 0 && current_line < max_lines)
825 DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length,
826 line_spacing, mask_mode, centered, current_line);
834 if (strEqual(token, ".font"))
835 font_nr = gfx.get_font_from_token_function(value);
836 else if (strEqual(token, ".autowrap"))
837 autowrap = get_boolean_from_string(value);
838 else if (strEqual(token, ".centered"))
839 centered = get_boolean_from_string(value);
840 else if (strEqual(token, ".parse_comments"))
841 parse_comments = get_boolean_from_string(value);
847 /* cut trailing newline and carriage return from input line */
848 for (line_ptr = line; *line_ptr; line_ptr++)
850 if (*line_ptr == '\n' || *line_ptr == '\r')
857 if (strlen(line) == 0) /* special case: force empty line */
862 while (*line_ptr && current_line < max_lines)
864 boolean buffer_filled;
868 buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len,
869 line_length, last_line_was_empty);
873 if (strlen(line_ptr) <= line_length)
875 buffer_len = strlen(line_ptr);
876 strcpy(buffer, line_ptr);
880 buffer_len = line_length;
881 strncpy(buffer, line_ptr, line_length);
884 buffer[buffer_len] = '\0';
885 line_ptr += buffer_len;
887 buffer_filled = TRUE;
893 DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length,
894 line_spacing, mask_mode, centered, current_line);
896 int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0);
898 (centered ? font_width * (line_length - buffer_len) / 2 : 0);
899 int final_cut_length = MAX(0, cut_length - offset_chars);
900 int xx = x + offset_xsize;
902 buffer[final_cut_length] = '\0';
905 DrawTextExt(drawto, xx, y + current_line * font_height, buffer,
908 DrawText(xx, y + current_line * font_height, buffer, font_nr);
913 last_line_was_empty = (buffer_len == 0);
921 if (buffer_len > 0 && current_line < max_lines)
924 DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length,
925 line_spacing, mask_mode, centered, current_line);
927 int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0);
929 (centered ? font_width * (line_length - buffer_len) / 2 : 0);
930 int final_cut_length = MAX(0, cut_length - offset_chars);
931 int xx = x + offset_xsize;
933 buffer[final_cut_length] = '\0';
936 DrawTextExt(drawto, xx, y + current_line * font_height, buffer,
939 DrawText(xx, y + current_line * font_height, buffer, font_nr);
948 int DrawTextBufferVA(int x, int y, char *format, va_list ap, int font_nr,
949 int line_length, int cut_length, int max_lines,
950 int line_spacing, int mask_mode, boolean autowrap,
951 boolean centered, boolean parse_comments)
953 char text_buffer[MAX_OUTPUT_LINESIZE];
954 int text_length = vsnprintf(text_buffer, MAX_OUTPUT_LINESIZE, format, ap);
956 if (text_length >= MAX_OUTPUT_LINESIZE)
957 Error(ERR_WARN, "string too long in DrawTextBufferVA() -- truncated");
959 int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr,
960 line_length, cut_length, max_lines,
961 line_spacing, mask_mode, autowrap,
962 centered, parse_comments);
963 return num_lines_printed;
966 int DrawTextFile(int x, int y, char *filename, int font_nr,
967 int line_length, int cut_length, int max_lines,
968 int line_spacing, int mask_mode, boolean autowrap,
969 boolean centered, boolean parse_comments)
971 char *text_buffer = GetTextBufferFromFile(filename, MAX_LINES_FROM_FILE);
972 int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr,
973 line_length, cut_length, max_lines,
974 line_spacing, mask_mode, autowrap,
975 centered, parse_comments);
976 checked_free(text_buffer);
978 return num_lines_printed;
982 void DrawTextWrapped(int x, int y, char *text, int font_nr, int line_length,
985 DrawTextBuffer(x, y, text, font_nr, line_length, -1, max_lines, -1, TRUE,
989 void DrawTextToTextArea(int x, int y, char *text, int font_nr, int line_length,
990 int cut_length, int max_lines, int mask_mode)
992 DrawTextBuffer(x, y, text, font_nr, line_length, cut_length, max_lines,
993 mask_mode, FALSE, FALSE, FALSE);