1 // ============================================================================
2 // Artsoft Retro-Game Library
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
19 /* ========================================================================= */
21 /* ========================================================================= */
23 void InitFontInfo(struct FontBitmapInfo *font_bitmap_info, int num_fonts,
24 int (*select_font_function)(int),
25 int (*get_font_from_token_function)(char *))
27 gfx.num_fonts = num_fonts;
28 gfx.font_bitmap_info = font_bitmap_info;
29 gfx.select_font_function = select_font_function;
30 gfx.get_font_from_token_function = get_font_from_token_function;
33 void FreeFontInfo(struct FontBitmapInfo *font_bitmap_info)
35 if (font_bitmap_info == NULL)
38 free(font_bitmap_info);
41 struct FontBitmapInfo *getFontBitmapInfo(int font_nr)
43 int font_bitmap_id = gfx.select_font_function(font_nr);
45 return &gfx.font_bitmap_info[font_bitmap_id];
48 int getFontWidth(int font_nr)
50 int font_bitmap_id = gfx.select_font_function(font_nr);
52 return gfx.font_bitmap_info[font_bitmap_id].width;
55 int getFontHeight(int font_nr)
57 int font_bitmap_id = gfx.select_font_function(font_nr);
59 return gfx.font_bitmap_info[font_bitmap_id].height;
62 int getTextWidth(char *text, int font_nr)
64 return (text != NULL ? strlen(text) * getFontWidth(font_nr) : 0);
67 static int getFontCharPosition(int font_nr, char c)
69 int font_bitmap_id = gfx.select_font_function(font_nr);
70 struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
71 boolean default_font = (font->num_chars == DEFAULT_NUM_CHARS_PER_FONT);
72 int font_pos = (unsigned char)c - 32;
74 /* map some special characters to their ascii values in default font */
76 font_pos = MAP_FONT_ASCII(c) - 32;
78 /* this allows dynamic special characters together with special font */
79 if (font_pos < 0 || font_pos >= font->num_chars)
85 void getFontCharSource(int font_nr, char c, Bitmap **bitmap, int *x, int *y)
87 int font_bitmap_id = gfx.select_font_function(font_nr);
88 struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
89 int font_pos = getFontCharPosition(font_nr, c);
91 *bitmap = font->bitmap;
92 *x = font->src_x + (font_pos % font->num_chars_per_line) * font->width;
93 *y = font->src_y + (font_pos / font->num_chars_per_line) * font->height;
97 /* ========================================================================= */
98 /* text string helper functions */
99 /* ========================================================================= */
101 int maxWordLengthInString(char *text)
104 int word_len = 0, max_word_len = 0;
106 for (text_ptr = text; *text_ptr; text_ptr++)
108 word_len = (*text_ptr != ' ' ? word_len + 1 : 0);
110 max_word_len = MAX(word_len, max_word_len);
117 /* ========================================================================= */
118 /* simple text drawing functions */
119 /* ========================================================================= */
121 void DrawInitTextExt(char *text, int ypos, int font_nr, boolean force)
125 static unsigned int progress_delay = 0;
126 unsigned int progress_delay_value = 100; /* (in milliseconds) */
129 // LimitScreenUpdates(TRUE); // (ignore "force" for now)
130 // LimitScreenUpdates(!force);
131 LimitScreenUpdates(TRUE);
136 if (!force && !DelayReached(&progress_delay, progress_delay_value))
140 if (window != NULL &&
141 gfx.draw_init_text &&
143 gfx.font_bitmap_info[font_nr].bitmap != NULL)
145 int x = (video.width - getTextWidth(text, font_nr)) / 2;
147 int width = video.width;
148 int height = getFontHeight(font_nr);
150 ClearRectangle(drawto, 0, y, width, height);
151 DrawTextExt(drawto, x, y, text, font_nr, BLIT_OPAQUE);
153 BlitBitmap(drawto, window, 0, 0, video.width, video.height, 0, 0);
156 static unsigned int progress_delay = 0;
157 unsigned int progress_delay_value = 100; /* (in milliseconds) */
159 // LimitScreenUpdates(TRUE); // (ignore "force" for now)
160 LimitScreenUpdates(!force);
164 if (!force && !DelayReached(&progress_delay, progress_delay_value))
167 if (window != NULL &&
168 gfx.draw_init_text &&
170 gfx.font_bitmap_info[font_nr].bitmap != NULL)
172 int x = (video.width - getTextWidth(text, font_nr)) / 2;
174 int width = video.width;
175 int height = getFontHeight(font_nr);
177 ClearRectangle(drawto, 0, y, width, height);
178 DrawTextExt(drawto, x, y, text, font_nr, BLIT_OPAQUE);
180 /* this makes things significantly faster than directly drawing to window */
181 BlitBitmap(drawto, window, 0, y, width, height, 0, y);
186 void DrawInitText(char *text, int ypos, int font_nr)
188 // DrawInitTextExt(text, ypos, font_nr, TRUE);
189 DrawInitTextExt(text, ypos, font_nr, FALSE);
192 void DrawInitTextAlways(char *text, int ypos, int font_nr)
194 DrawInitTextExt(text, ypos, font_nr, TRUE);
197 void DrawInitTextIfNeeded(char *text, int ypos, int font_nr)
199 DrawInitTextExt(text, ypos, font_nr, FALSE);
202 void DrawTextF(int x, int y, int font_nr, char *format, ...)
204 char buffer[MAX_OUTPUT_LINESIZE + 1];
207 va_start(ap, format);
208 vsprintf(buffer, format, ap);
211 if (strlen(buffer) > MAX_OUTPUT_LINESIZE)
212 Error(ERR_EXIT, "string too long in DrawTextF() -- aborting");
214 DrawText(gfx.sx + x, gfx.sy + y, buffer, font_nr);
217 void DrawTextFCentered(int y, int font_nr, char *format, ...)
219 char buffer[MAX_OUTPUT_LINESIZE + 1];
222 va_start(ap, format);
223 vsprintf(buffer, format, ap);
226 if (strlen(buffer) > MAX_OUTPUT_LINESIZE)
227 Error(ERR_EXIT, "string too long in DrawTextFCentered() -- aborting");
229 DrawText(gfx.sx + (gfx.sxsize - getTextWidth(buffer, font_nr)) / 2,
230 gfx.sy + y, buffer, font_nr);
233 void DrawTextS(int x, int y, int font_nr, char *text)
235 DrawText(gfx.sx + x, gfx.sy + y, text, font_nr);
238 void DrawTextSCentered(int y, int font_nr, char *text)
240 DrawText(gfx.sx + (gfx.sxsize - getTextWidth(text, font_nr)) / 2,
241 gfx.sy + y, text, font_nr);
244 void DrawTextCentered(int y, int font_nr, char *text)
246 DrawText((gfx.sxsize - getTextWidth(text, font_nr)) / 2, y, text, font_nr);
249 void DrawTextSAligned(int x, int y, char *text, int font_nr, int align)
251 DrawText(gfx.sx + ALIGNED_XPOS(x, getTextWidth(text, font_nr), align),
252 gfx.sx + y, text, font_nr);
255 void DrawTextAligned(int x, int y, char *text, int font_nr, int align)
257 DrawText(ALIGNED_XPOS(x, getTextWidth(text, font_nr), align),
261 void DrawText(int x, int y, char *text, int font_nr)
263 int mask_mode = BLIT_OPAQUE;
265 if (DrawingOnBackground(x, y))
266 mask_mode = BLIT_ON_BACKGROUND;
268 DrawTextExt(drawto, x, y, text, font_nr, mask_mode);
271 if (IN_GFX_FIELD_FULL(x, y))
272 redraw_mask |= REDRAW_FIELD;
273 else if (IN_GFX_DOOR_1(x, y))
274 redraw_mask |= REDRAW_DOOR_1;
275 else if (IN_GFX_DOOR_2(x, y))
276 redraw_mask |= REDRAW_DOOR_2;
277 else if (IN_GFX_DOOR_3(x, y))
278 redraw_mask |= REDRAW_DOOR_3;
280 redraw_mask |= REDRAW_ALL;
283 redraw_mask |= REDRAW_FIELD;
284 else if (y < gfx.vy || gfx.vy == 0)
285 redraw_mask |= REDRAW_DOOR_1;
289 void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text,
290 int font_nr, int mask_mode)
293 struct FontBitmapInfo *font = getFontBitmapInfo(font_nr);
295 int font_bitmap_id = gfx.select_font_function(font_nr);
296 struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
298 int font_width = getFontWidth(font_nr);
299 int font_height = getFontHeight(font_nr);
301 int border_1 = gfx.sx + gfx.sxsize;
302 int border_2 = gfx.dx + gfx.dxsize;
303 int dst_x_start = dst_x;
307 char *text_ptr = text;
309 if (font->bitmap == NULL)
312 /* skip text to be printed outside the window (left/right will be clipped) */
313 if (dst_y < 0 || dst_y + font_height > video.height)
316 /* add offset for drawing font characters */
317 dst_x += font->draw_xoffset;
318 dst_y += font->draw_yoffset;
322 char c = *text_ptr++;
325 c = ' '; /* print space instead of newline */
327 getFontCharSource(font_nr, c, &src_bitmap, &src_x, &src_y);
329 /* clip text at the left side of the window */
337 /* clip text at the right side of the window */
339 if (dst_x + font_width > video.width)
342 /* (this does not work well when trying to print text to whole screen) */
343 if ((dst_x_start < border_1 && dst_x + font_width > border_1) ||
344 (dst_x_start < border_2 && dst_x + font_width > border_2))
348 if (mask_mode == BLIT_INVERSE) /* special mode for text gadgets */
350 /* first step: draw solid colored rectangle (use "cursor" character) */
351 if (strlen(text) == 1) /* only one char inverted => draw cursor */
353 Bitmap *cursor_bitmap;
354 int cursor_x, cursor_y;
356 getFontCharSource(font_nr, FONT_ASCII_CURSOR, &cursor_bitmap,
357 &cursor_x, &cursor_y);
359 BlitBitmap(cursor_bitmap, dst_bitmap, cursor_x, cursor_y,
360 font_width, font_height, dst_x, dst_y);
363 #if defined(TARGET_SDL)
364 /* second step: draw masked inverted character */
365 SDLCopyInverseMasked(src_bitmap, dst_bitmap, src_x, src_y,
366 font_width, font_height, dst_x, dst_y);
368 /* second step: draw masked black rectangle (use "space" character) */
369 SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc,
370 dst_x - src_x, dst_y - src_y);
371 BlitBitmapMasked(src_bitmap, dst_bitmap, 0, 0,
372 font_width, font_height, dst_x, dst_y);
375 else if (mask_mode == BLIT_MASKED || mask_mode == BLIT_ON_BACKGROUND)
377 if (mask_mode == BLIT_ON_BACKGROUND)
379 /* clear font character background */
380 ClearRectangleOnBackground(dst_bitmap, dst_x, dst_y,
381 font_width, font_height);
384 SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc,
385 dst_x - src_x, dst_y - src_y);
387 BlitBitmapMasked(src_bitmap, dst_bitmap, src_x, src_y,
388 font_width, font_height, dst_x, dst_y);
390 else /* normal, non-masked font blitting */
392 BlitBitmap(src_bitmap, dst_bitmap, src_x, src_y,
393 font_width, font_height, dst_x, dst_y);
401 /* ========================================================================= */
402 /* text buffer drawing functions */
403 /* ========================================================================= */
405 #define MAX_LINES_FROM_FILE 1024
409 char *GetTextBufferFromFile(char *filename, int max_lines)
415 if (filename == NULL)
418 if (!(file = openFile(filename, MODE_READ)))
421 buffer = checked_calloc(1); /* start with valid, but empty text buffer */
423 while (!checkEndOfFile(file) && num_lines < max_lines)
425 char line[MAX_LINE_LEN];
427 /* read next line of input file */
428 if (!getStringFromFile(file, line, MAX_LINE_LEN))
431 buffer = checked_realloc(buffer, strlen(buffer) + strlen(line) + 1);
433 strcat(buffer, line);
445 char *GetTextBufferFromFile(char *filename, int max_lines)
451 if (filename == NULL)
454 if (!(file = fopen(filename, MODE_READ)))
457 buffer = checked_calloc(1); /* start with valid, but empty text buffer */
459 while (!feof(file) && num_lines < max_lines)
461 char line[MAX_LINE_LEN];
463 /* read next line of input file */
464 if (!fgets(line, MAX_LINE_LEN, file))
467 buffer = checked_realloc(buffer, strlen(buffer) + strlen(line) + 1);
469 strcat(buffer, line);
481 void DrawTextToTextArea_OLD(int x, int y, char *text, int font_nr, int line_length,
482 int area_xsize, int area_ysize, int mask_mode)
485 int font_height = getFontHeight(font_nr);
490 while (*text && area_line < area_ysize)
492 char buffer[MAX_OUTPUT_LINESIZE + 1];
495 for (i = 0; i < line_length && *text; i++)
496 if ((buffer[i] = *text++) == '\n')
498 buffer[MIN(i, area_xsize)] = '\0';
500 DrawTextExt(drawto, x, y + area_line * font_height, buffer, font_nr,
506 redraw_mask |= REDRAW_FIELD;
509 static boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer,
510 int *dst_buffer_len, int line_length,
511 boolean last_line_was_empty)
513 char *text_ptr = *src_buffer_ptr;
514 char *buffer = dst_buffer;
515 int buffer_len = *dst_buffer_len;
516 boolean buffer_filled = FALSE;
523 /* skip leading whitespaces */
524 while (*text_ptr == ' ' || *text_ptr == '\t')
530 /* look for end of next word */
531 while (*word_ptr != ' ' && *word_ptr != '\t' && *word_ptr != '\0')
541 else if (*text_ptr == '\n') /* special case: force empty line */
546 /* prevent printing of multiple empty lines */
547 if (buffer_len > 0 || !last_line_was_empty)
548 buffer_filled = TRUE;
550 else if (word_len < line_length - buffer_len)
552 /* word fits into text buffer -- add word */
555 buffer[buffer_len++] = ' ';
557 strncpy(&buffer[buffer_len], text_ptr, word_len);
558 buffer_len += word_len;
559 buffer[buffer_len] = '\0';
560 text_ptr += word_len;
562 else if (buffer_len > 0)
564 /* not enough space left for word in text buffer -- print buffer */
566 buffer_filled = TRUE;
570 /* word does not fit at all into empty text buffer -- cut word */
572 strncpy(buffer, text_ptr, line_length);
573 buffer[line_length] = '\0';
574 text_ptr += line_length;
575 buffer_filled = TRUE;
582 *src_buffer_ptr = text_ptr;
583 *dst_buffer_len = buffer_len;
585 return buffer_filled;
589 void DrawTextWrapped_OLD(int x, int y, char *text, int font_nr, int line_length,
592 char *text_ptr = text;
593 int current_line = 0;
594 int font_height = getFontHeight(font_nr);
596 while (*text_ptr && current_line < max_lines)
598 char buffer[line_length + 1];
603 RenderLineToBuffer(&text_ptr, buffer, &buffer_len, line_length, TRUE);
605 DrawText(x, y + current_line * font_height, buffer, font_nr);
612 int DrawTextFromFile_OLD(int x, int y, char *filename, int font_nr,
613 int line_length, int max_lines, boolean wrap_text)
615 int font_height = getFontHeight(font_nr);
616 char line[MAX_LINE_LEN];
617 char buffer[line_length + 1];
619 int current_line = 0;
622 if (current_line >= max_lines)
625 if (filename == NULL)
628 if (!(file = fopen(filename, MODE_READ)))
634 while (!feof(file) && current_line < max_lines)
637 boolean last_line_was_empty = TRUE;
639 /* read next line of input file */
640 if (!fgets(line, MAX_LINE_LEN, file))
643 /* skip comments (lines directly beginning with '#') */
647 /* cut trailing newline from input line */
648 for (line_ptr = line; *line_ptr; line_ptr++)
650 if (*line_ptr == '\n' || *line_ptr == '\r')
657 if (strlen(line) == 0) /* special case: force empty line */
662 while (*line_ptr && current_line < max_lines)
665 boolean buffer_filled;
669 buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len,
670 line_length, last_line_was_empty);
674 if (strlen(line_ptr) <= line_length)
676 buffer_len = strlen(line_ptr);
677 strcpy(buffer, line_ptr);
681 buffer_len = line_length;
682 strncpy(buffer, line_ptr, line_length);
685 buffer[buffer_len] = '\0';
686 line_ptr += buffer_len;
688 buffer_filled = TRUE;
691 boolean buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len,
692 line_length, last_line_was_empty);
697 DrawText(x, y + current_line * font_height, buffer, font_nr);
700 last_line_was_empty = (buffer_len == 0);
710 if (buffer_len > 0 && current_line < max_lines)
712 DrawText(x, y + current_line * font_height, buffer, font_nr);
720 static boolean getCheckedTokenValueFromString(char *string, char **token,
725 if (!getTokenValueFromString(string, token, value))
728 if (**token != '.') /* token should begin with dot */
731 for (ptr = *token; *ptr; ptr++) /* token should contain no whitespace */
732 if (*ptr == ' ' || *ptr == '\t')
735 for (ptr = *value; *ptr; ptr++) /* value should contain no whitespace */
736 if (*ptr == ' ' || *ptr == '\t')
742 static void DrawTextBuffer_Flush(int x, int y, char *buffer, int font_nr,
743 int line_length, int cut_length,
744 int line_spacing, int mask_mode,
745 boolean centered, int current_line)
747 int buffer_len = strlen(buffer);
748 int font_width = getFontWidth(font_nr);
749 int font_height = getFontHeight(font_nr);
750 int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0);
752 (centered ? font_width * (line_length - buffer_len) / 2 : 0);
753 int final_cut_length = MAX(0, cut_length - offset_chars);
754 int xx = x + offset_xsize;
755 int yy = y + current_line * (font_height + line_spacing);
757 buffer[final_cut_length] = '\0';
760 DrawTextExt(drawto, xx, yy, buffer, font_nr, mask_mode);
762 DrawText(xx, yy, buffer, font_nr);
765 int DrawTextBuffer(int x, int y, char *text_buffer, int font_nr,
766 int line_length, int cut_length, int max_lines,
767 int line_spacing, int mask_mode, boolean autowrap,
768 boolean centered, boolean parse_comments)
771 int font_width = getFontWidth(font_nr);
772 int font_height = getFontHeight(font_nr);
774 char buffer[line_length + 1];
776 int current_line = 0;
778 if (text_buffer == NULL || *text_buffer == '\0')
781 if (current_line >= max_lines)
784 if (cut_length == -1)
785 cut_length = line_length;
790 while (*text_buffer && current_line < max_lines)
792 char line[MAX_LINE_LEN + 1];
794 boolean last_line_was_empty = TRUE;
796 int num_line_chars = MAX_LINE_LEN;
798 int num_line_chars = (autowrap ? MAX_LINE_LEN : line_length);
802 /* copy next line from text buffer to line buffer (nearly fgets() style) */
803 for (i = 0; i < num_line_chars && *text_buffer; i++)
804 if ((line[i] = *text_buffer++) == '\n')
808 /* prevent 'num_line_chars' sized lines to cause additional empty line */
809 if (i == num_line_chars && *text_buffer == '\n')
812 /* skip comments (lines directly beginning with '#') */
813 if (line[0] == '#' && parse_comments)
817 /* try to read generic token/value pair definition after comment sign */
818 if (getCheckedTokenValueFromString(line + 1, &token, &value))
820 /* if found, flush the current buffer, if non-empty */
821 if (buffer_len > 0 && current_line < max_lines)
823 DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length,
824 line_spacing, mask_mode, centered, current_line);
832 if (strEqual(token, ".font"))
833 font_nr = gfx.get_font_from_token_function(value);
834 else if (strEqual(token, ".autowrap"))
835 autowrap = get_boolean_from_string(value);
836 else if (strEqual(token, ".centered"))
837 centered = get_boolean_from_string(value);
838 else if (strEqual(token, ".parse_comments"))
839 parse_comments = get_boolean_from_string(value);
845 /* cut trailing newline and carriage return from input line */
846 for (line_ptr = line; *line_ptr; line_ptr++)
848 if (*line_ptr == '\n' || *line_ptr == '\r')
855 if (strlen(line) == 0) /* special case: force empty line */
860 while (*line_ptr && current_line < max_lines)
862 boolean buffer_filled;
866 buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len,
867 line_length, last_line_was_empty);
871 if (strlen(line_ptr) <= line_length)
873 buffer_len = strlen(line_ptr);
874 strcpy(buffer, line_ptr);
878 buffer_len = line_length;
879 strncpy(buffer, line_ptr, line_length);
882 buffer[buffer_len] = '\0';
883 line_ptr += buffer_len;
885 buffer_filled = TRUE;
891 DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length,
892 line_spacing, mask_mode, centered, current_line);
894 int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0);
896 (centered ? font_width * (line_length - buffer_len) / 2 : 0);
897 int final_cut_length = MAX(0, cut_length - offset_chars);
898 int xx = x + offset_xsize;
900 buffer[final_cut_length] = '\0';
903 DrawTextExt(drawto, xx, y + current_line * font_height, buffer,
906 DrawText(xx, y + current_line * font_height, buffer, font_nr);
911 last_line_was_empty = (buffer_len == 0);
919 if (buffer_len > 0 && current_line < max_lines)
922 DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length,
923 line_spacing, mask_mode, centered, current_line);
925 int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0);
927 (centered ? font_width * (line_length - buffer_len) / 2 : 0);
928 int final_cut_length = MAX(0, cut_length - offset_chars);
929 int xx = x + offset_xsize;
931 buffer[final_cut_length] = '\0';
934 DrawTextExt(drawto, xx, y + current_line * font_height, buffer,
937 DrawText(xx, y + current_line * font_height, buffer, font_nr);
946 int DrawTextBufferVA(int x, int y, char *format, va_list ap, int font_nr,
947 int line_length, int cut_length, int max_lines,
948 int line_spacing, int mask_mode, boolean autowrap,
949 boolean centered, boolean parse_comments)
951 char text_buffer[MAX_OUTPUT_LINESIZE];
952 int text_length = vsnprintf(text_buffer, MAX_OUTPUT_LINESIZE, format, ap);
954 if (text_length >= MAX_OUTPUT_LINESIZE)
955 Error(ERR_WARN, "string too long in DrawTextBufferVA() -- truncated");
957 int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr,
958 line_length, cut_length, max_lines,
959 line_spacing, mask_mode, autowrap,
960 centered, parse_comments);
961 return num_lines_printed;
964 int DrawTextFile(int x, int y, char *filename, int font_nr,
965 int line_length, int cut_length, int max_lines,
966 int line_spacing, int mask_mode, boolean autowrap,
967 boolean centered, boolean parse_comments)
969 char *text_buffer = GetTextBufferFromFile(filename, MAX_LINES_FROM_FILE);
970 int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr,
971 line_length, cut_length, max_lines,
972 line_spacing, mask_mode, autowrap,
973 centered, parse_comments);
974 checked_free(text_buffer);
976 return num_lines_printed;
980 void DrawTextWrapped(int x, int y, char *text, int font_nr, int line_length,
983 DrawTextBuffer(x, y, text, font_nr, line_length, -1, max_lines, -1, TRUE,
987 void DrawTextToTextArea(int x, int y, char *text, int font_nr, int line_length,
988 int cut_length, int max_lines, int mask_mode)
990 DrawTextBuffer(x, y, text, font_nr, line_length, cut_length, max_lines,
991 mask_mode, FALSE, FALSE, FALSE);