ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit e1e4acd5487fda9f995293102370bbbee86c2099
parent 3488cb670d571812360ef1a64bf3df3ac4706020
Author: Frederic Cambus <fred@statdns.com>
Date:   Sat, 16 Jan 2016 15:08:37 +0100

Remove support for drawing bold, italics and underline characters for Amiga fonts

Diffstat:
Msrc/ansilove.c | 133++-----------------------------------------------------------------------------
1 file changed, 3 insertions(+), 130 deletions(-)

diff --git a/src/ansilove.c b/src/ansilove.c @@ -762,136 +762,9 @@ void alAnsiLoader(char *input, char *output, char *retinaout, char *font, int32_ position_x = ansi_buffer[loop].position_x; position_y = ansi_buffer[loop].position_y; - if (!fontData.isAmigaFont) - { - gdImageCopy(im_ANSi, im_Backgrnd, position_x * int_bits, - position_y * fontData.font_size_y, color_background * 9, 0, int_bits, fontData.font_size_y); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits, position_y * fontData.font_size_y, - character * fontData.font_size_x, color_foreground * fontData.font_size_y, int_bits, fontData.font_size_y); - } - else - { - if (color_background != 0 || !italics) - { - gdImageCopy(im_ANSi, im_Backgrnd, position_x * int_bits, - position_y * fontData.font_size_y, color_background * 9, 0, int_bits, fontData.font_size_y); - } - - if (!italics) - { - gdImageCopy(im_ANSi, im_Font, position_x * int_bits, position_y * fontData.font_size_y, - character * fontData.font_size_x, color_foreground * fontData.font_size_y, int_bits, fontData.font_size_y); - } - else - { - gdImageCopy(im_ANSi, im_Font, position_x * int_bits + 3, position_y * fontData.font_size_y, - character * fontData.font_size_x, color_foreground * fontData.font_size_y, int_bits,2); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits + 2, position_y * fontData.font_size_y + 2, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 2, int_bits, 4); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits + 1, position_y * fontData.font_size_y + 6, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 6, int_bits, 4); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits, position_y * fontData.font_size_y + 10, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 10, int_bits,4); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits - 1, position_y * fontData.font_size_y + 14, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 14, int_bits, 2); - } - - if (italics && bold) - { - gdImageCopy(im_ANSi, im_Font, position_x * int_bits + 3 + 1, position_y * fontData.font_size_y, - character * fontData.font_size_x, color_foreground * fontData.font_size_y ,int_bits, 2); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits + 2 + 1, position_y * fontData.font_size_y + 2, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 2, int_bits, 4); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits + 1 + 1, position_y * fontData.font_size_y + 6, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 6, int_bits, 4); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits + 1, position_y * fontData.font_size_y + 10, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 10, int_bits, 4); - - gdImageCopy(im_ANSi, im_Font, position_x * int_bits - 1 + 1, position_y * fontData.font_size_y + 14, - character * fontData.font_size_x, color_foreground * fontData.font_size_y + 14, int_bits, 2); - } - - if (bold && !italics && (ced || workbench)) - { - gdImageCopy(im_ANSi, im_Font, 1 + position_x * int_bits, position_y * fontData.font_size_y, - character * fontData.font_size_x, color_foreground * fontData.font_size_y, int_bits, fontData.font_size_y); - } - - if (underline) - { - loop_column = 0; - character_size_x = 8; - - if (bold) - { - character_size_x++; - } - - if (italics) - { - loop_column=-1; - character_size_x = 11; - } - - while (loop_column < character_size_x) - { - if (gdImageGetPixel(im_ANSi, position_x * int_bits + loop_column, - position_y * fontData.font_size_y + 15) == color_background && - gdImageGetPixel(im_ANSi, position_x * int_bits +loop_column + 1, - position_y * fontData.font_size_y + 15) == color_background) - { - gdImageSetPixel(im_ANSi, position_x * int_bits + loop_column, - position_y * fontData.font_size_y + 14, colors[color_foreground]); - - gdImageSetPixel(im_ANSi, position_x * int_bits + loop_column, - position_y * fontData.font_size_y + 15, colors[color_foreground]); - } - else if (gdImageGetPixel(im_ANSi, position_x * int_bits + loop_column, - position_y * fontData.font_size_y + 15) != color_background && - gdImageGetPixel(im_ANSi, position_x * int_bits + loop_column + 1, - position_y * fontData.font_size_y + 15) == color_background) - { - loop_column++; - } - loop_column++; - } - - if (pixelCarry) - { - gdImageSetPixel(im_ANSi, position_x * int_bits, - position_y * fontData.font_size_y + 14, colors[color_foreground]); - - gdImageSetPixel(im_ANSi, position_x * int_bits, - position_y * fontData.font_size_y + 15, colors[color_foreground]); - - pixelCarry = false; - } - - if (gdImageGetPixel(im_Font, character * fontData.font_size_x, - color_foreground * fontData.font_size_y + 15) != 20) - { - gdImageSetPixel(im_ANSi, position_x * int_bits - 1, - position_y * fontData.font_size_y + 14, colors[color_foreground]); - - gdImageSetPixel(im_ANSi, position_x * int_bits - 1, - position_y * fontData.font_size_y + 15, colors[color_foreground]); - } - - if (gdImageGetPixel(im_Font, character *fontData. font_size_x + character_size_x - 1, - color_foreground * fontData.font_size_y + 15) != 20) - { - pixelCarry = true; - } - } - } + alDrawChar(im_ANSi, fontData.font_data, int_bits, fontData.font_size_y, + position_x, position_y, colors[color_background], colors[color_foreground], character); + } // transparent flag used?