gfx.num_fonts = num_fonts;
gfx.font_bitmap_info = font_bitmap_info;
gfx.select_font_function = select_font_function;
+ gfx.inverse_text_color = WHITE_PIXEL;
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
InitFontClipmasks();
#endif
}
+void SetInverseTextColor(Pixel inverse_text_color)
+{
+ gfx.inverse_text_color = inverse_text_color;
+}
+
int getFontWidth(int font_nr)
{
int font_bitmap_id = gfx.select_font_function(font_nr);
ClearRectangle(window, 0, ypos, video.width, getFontHeight(font_nr));
DrawTextExt(window, (video.width - text_width) / 2, ypos, text, font_nr,
- FONT_OPAQUE);
+ BLIT_OPAQUE);
FlushDisplay();
}
}
void DrawText(int x, int y, char *text, int font_nr)
{
- int mask_mode = FONT_OPAQUE;
+ int mask_mode = BLIT_OPAQUE;
if (DrawingOnBackground(x, y))
- mask_mode = FONT_MASKED;
+ mask_mode = BLIT_MASKED;
DrawTextExt(drawto, x, y, text, font_nr, mask_mode);
else if (c == '\\') /* bad luck ... */
c = '/';
-#if 1
if (getFontChar(font_nr, c, &src_x, &src_y))
{
-#else
- if ((c >= 32 && c <= 95) || c == '°' || c == '´' || c == '|')
- {
- int src_x= font->src_x + ((c - 32) % FONT_CHARS_PER_LINE) * font->width;
- int src_y= font->src_y + ((c - 32) / FONT_CHARS_PER_LINE) * font->height;
-
- if (c == '°' || c == '´' || c == '|') /* map '°' and 'TM' signs */
- {
- src_x = font->src_x + FONT_CHARS_PER_LINE * font->width;
- src_y = font->src_y + (c == '°' ? 1 : c == '´' ? 2 : 3) * font->height;
- }
-#endif
-
if (print_inverse) /* special mode for text gadgets */
{
+#if defined(TARGET_SDL)
+ /* blit normally (non-masked) */
+ BlitBitmap(font->bitmap, dst_bitmap, src_x, src_y,
+ font->width, font->height, dst_x, dst_y);
+
+ /* invert character */
+ SDLInvertArea(dst_bitmap, dst_x, dst_y, font->width, font->height,
+ gfx.inverse_text_color);
+#else
/* first step: draw solid colored rectangle (use "cursor" character) */
if (print_inverse_cursor)
BlitBitmap(font->bitmap, dst_bitmap,
dst_x - src_x, dst_y - src_y);
BlitBitmapMasked(font->bitmap, dst_bitmap,
0, 0, font->width, font->height, dst_x, dst_y);
+#endif
}
- else if (mask_mode == FONT_MASKED)
+ else if (mask_mode == BLIT_MASKED)
{
/* clear font character background */
ClearRectangleOnBackground(dst_bitmap, dst_x, dst_y,