From 64ea3cba10d98ed9e554f3d525596463cd2d094e Mon Sep 17 00:00:00 2001 From: Josh Renaud Date: Mon, 17 Feb 2025 18:25:29 -0600 Subject: [PATCH 1/4] Changes to add support for Atari ST ANSIterm font --- include/ansilove.h | 3 + man/libansilove.3 | 4 +- src/fonts.c | 8 + src/fonts.h | 2 + src/fonts/font_atari_ansiterm.h | 344 ++++++++++++++++++++++++++++++++ 5 files changed, 359 insertions(+), 2 deletions(-) create mode 100644 src/fonts/font_atari_ansiterm.h diff --git a/include/ansilove.h b/include/ansilove.h index e8d6970..59a0a16 100644 --- a/include/ansilove.h +++ b/include/ansilove.h @@ -70,6 +70,9 @@ extern "C" { #define ANSILOVE_FONT_TOPAZ500 36 #define ANSILOVE_FONT_TOPAZ500_PLUS 37 +/* Atari fonts */ +#define ANSILOVE_FONT_ANSITERM 40 + /* Rendering modes */ #define ANSILOVE_MODE_CED 1 #define ANSILOVE_MODE_TRANSPARENT 2 diff --git a/man/libansilove.3 b/man/libansilove.3 index bbb0412..ecc2ec0 100644 --- a/man/libansilove.3 +++ b/man/libansilove.3 @@ -37,8 +37,8 @@ images, supporting ANSI (.ANS), PCBoard (.PCB), Binary (.BIN), Artworx (.ADF), iCE Draw (.IDF), Tundra (.TND) and XBin (.XB) formats. .Pp It creates size optimized 4-bit PNG files and supports 80x25 and 80x50 -PC fonts (including all the 14 MS-DOS charsets), Amiga fonts, and -iCE colors. +PC fonts (including all the 14 MS-DOS charsets), Amiga and Atari fonts, +and iCE colors. .Pp All library functions take a context, defined as an .Em ansilove_ctx diff --git a/src/fonts.c b/src/fonts.c index ea51fb9..71db72e 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -40,6 +40,8 @@ #include "fonts/font_amiga_topaz_1200_plus.h" #include "fonts/font_amiga_topaz_500.h" #include "fonts/font_amiga_topaz_500_plus.h" +#include "fonts/font_atari_ansiterm.h" + void select_font(struct fontStruct *fontData, int font) @@ -173,6 +175,12 @@ select_font(struct fontStruct *fontData, int font) fontData->width = 8; fontData->height = 16; break; + case ANSILOVE_FONT_ANSITERM: + fontData->font_data = font_atari_ansiterm; + fontData->width = 8; + fontData->height = 16; + break; + default: /* in all other cases use the standard DOS font */ fontData->font_data = font_pc_80x25; diff --git a/src/fonts.h b/src/fonts.h index 27561fb..4243ae1 100644 --- a/src/fonts.h +++ b/src/fonts.h @@ -54,4 +54,6 @@ extern const uint8_t font_amiga_topaz_1200_plus[4096]; extern const uint8_t font_amiga_topaz_500[4096]; extern const uint8_t font_amiga_topaz_500_plus[4096]; +extern const uint8_t font_atari_ansiterm[4096]; + #endif /* FONTS_H */ diff --git a/src/fonts/font_atari_ansiterm.h b/src/fonts/font_atari_ansiterm.h new file mode 100644 index 0000000..3186c1e --- /dev/null +++ b/src/fonts/font_atari_ansiterm.h @@ -0,0 +1,344 @@ +const uint8_t font_atari_ansiterm[4096] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xfc, 0xfc, 0xfc, 0xfc, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0xfc, 0xfc, 0xfc, 0xfc, 0x30, 0x30, 0x00, 0x00, + 0xcc, 0xcc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0x30, 0x30, + 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xfc, 0xfc, 0xfc, 0xfc, + 0xfc, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0xfc, 0xfc, 0xfc, 0xfc, + 0x30, 0x30, 0xfc, 0xfc, 0x30, 0x30, 0x30, 0x30, 0xfc, 0xfc, 0x00, 0x00, + 0x30, 0x30, 0xfc, 0xfc, 0xfc, 0xfc, 0xcc, 0xcc, 0x30, 0x30, 0x30, 0x30, + 0xfc, 0xfc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x30, 0x30, + 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x3c, 0x3c, 0x0c, 0x0c, 0x00, 0x00, + 0x30, 0x30, 0xfc, 0xfc, 0xcc, 0xcc, 0xfc, 0xfc, 0xcc, 0xcc, 0xfc, 0xfc, + 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3f, 0x3f, + 0x0c, 0x0c, 0x0f, 0x0f, 0x0c, 0x0c, 0x00, 0x00, 0x30, 0x30, 0x3c, 0x3c, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, + 0xf0, 0xf0, 0xc0, 0xc0, 0xfc, 0xfc, 0xf0, 0xf0, 0x3c, 0x3c, 0x30, 0x30, + 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x33, 0x33, 0xff, 0xff, 0x30, 0x30, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xf3, 0xf3, 0xc3, 0xc3, 0x00, 0x00, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x3c, + 0x0c, 0x0c, 0x00, 0x00, 0xfc, 0xfc, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, + 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0xfc, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, + 0xfc, 0xfc, 0x0c, 0x0c, 0x0c, 0x0c, 0xfc, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, + 0xfc, 0xfc, 0x00, 0x00, 0xfc, 0xfc, 0x0c, 0x0c, 0x0c, 0x0c, 0xfc, 0xfc, + 0x0c, 0x0c, 0x0c, 0x0c, 0xfc, 0xfc, 0x00, 0x00, 0x3c, 0x3c, 0xfc, 0xfc, + 0xfc, 0xfc, 0xfc, 0xfc, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, + 0x3c, 0x3c, 0xc0, 0xc0, 0x3c, 0x3c, 0xcc, 0xcc, 0xf0, 0xf0, 0x0c, 0x0c, + 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, + 0x30, 0x30, 0xfc, 0xfc, 0x30, 0x30, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xf0, 0xc0, 0xc0, 0xf0, 0xf0, 0xc0, 0xc0, 0xfc, 0xfc, 0x30, 0x30, + 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, + 0xff, 0xff, 0xcc, 0xcc, 0xcc, 0xcc, 0xff, 0xff, 0xcc, 0xcc, 0x00, 0x00, + 0x30, 0x30, 0xfc, 0xfc, 0xc0, 0xc0, 0xfc, 0xfc, 0x0c, 0x0c, 0xfc, 0xfc, + 0x30, 0x30, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x0c, 0x0c, 0x30, 0x30, + 0xc0, 0xc0, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x30, 0x30, 0xcc, 0xcc, + 0xcc, 0xcc, 0x30, 0x30, 0xcf, 0xcf, 0xcc, 0xcc, 0xf3, 0xf3, 0x00, 0x00, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0xf0, 0xf0, 0xc0, 0xc0, 0xc0, 0xc0, + 0xc0, 0xc0, 0xf0, 0xf0, 0x3c, 0x3c, 0x00, 0x00, 0xf0, 0xf0, 0x3c, 0x3c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x3c, 0xf0, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0xcc, 0xcc, 0x30, 0x30, 0xfc, 0xfc, 0x30, 0x30, 0xcc, 0xcc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xfc, 0xfc, + 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, + 0x30, 0x30, 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0xfc, 0xcc, 0xcc, 0xcc, 0xcc, + 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0xfc, 0xfc, 0x00, 0x00, 0x30, 0x30, 0xcc, 0xcc, + 0x0c, 0x0c, 0x30, 0x30, 0xc0, 0xc0, 0xcc, 0xcc, 0xfc, 0xfc, 0x00, 0x00, + 0x30, 0x30, 0xcc, 0xcc, 0x0c, 0x0c, 0x30, 0x30, 0x0c, 0x0c, 0xcc, 0xcc, + 0x30, 0x30, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0xfc, + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0xfc, 0xfc, 0xc0, 0xc0, + 0xf0, 0xf0, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0xcc, 0xcc, 0xc0, 0xc0, 0xf0, 0xf0, 0xcc, 0xcc, 0xcc, 0xcc, + 0x30, 0x30, 0x00, 0x00, 0xfc, 0xfc, 0x0c, 0x0c, 0x0c, 0x0c, 0x30, 0x30, + 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x30, 0x30, 0xcc, 0xcc, + 0xcc, 0xcc, 0x30, 0x30, 0xcc, 0xcc, 0xcc, 0xcc, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0xcc, 0xcc, 0xcc, 0xcc, 0x3c, 0x3c, 0x0c, 0x0c, 0xcc, 0xcc, + 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, + 0x00, 0x00, 0x0c, 0x0c, 0x30, 0x30, 0xc0, 0xc0, 0x30, 0x30, 0x0c, 0x0c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, + 0x30, 0x30, 0x0c, 0x0c, 0x30, 0x30, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x30, 0xcc, 0xcc, 0x0c, 0x0c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0xcc, 0xcc, 0xfc, 0xfc, 0xfc, 0xfc, + 0xfc, 0xfc, 0xc0, 0xc0, 0x3c, 0x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xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0x3c, 0x3c, 0x0c, 0x0c, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0xfc, 0x0c, 0x0c, 0x30, 0x30, 0xc0, 0xc0, 0xfc, 0xfc, 0x00, 0x00, + 0x0c, 0x0c, 0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30, + 0x0c, 0x0c, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0x30, 0x30, + 0x30, 0x30, 0x0c, 0x0c, 0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x33, 0x33, 0xff, 0xff, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, + 0xcc, 0xcc, 0xc0, 0xc0, 0xc0, 0xc0, 0xcc, 0xcc, 0x30, 0x30, 0xf0, 0xf0, + 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0x3c, 0x3c, 0x00, 0x00, 0x0c, 0x0c, 0x30, 0x30, 0x00, 0x00, 0x3c, 0x3c, + 0xfc, 0xfc, 0xc0, 0xc0, 0x3c, 0x3c, 0x00, 0x00, 0x30, 0x30, 0xcc, 0xcc, + 0x00, 0x00, 0xf0, 0xf0, 0x0c, 0x0c, 0xfc, 0xfc, 0x3c, 0x3c, 0x00, 0x00, + 0xcc, 0xcc, 0x00, 0x00, 0xf0, 0xf0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xf0, 0xf0, 0x0c, 0x0c, 0x3c, 0x3c, + 0xcc, 0xcc, 0x3c, 0x3c, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x30, 0x30, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x30, 0x30, 0x00, 0x00, 0xfc, 0xfc, + 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, + 0xcc, 0xcc, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, + 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xfc, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, + 0xc0, 0xc0, 0xcc, 0xcc, 0x30, 0x30, 0xcc, 0xcc, 0x3c, 0x3c, 0x0c, 0x0c, + 0x3c, 0x3c, 0x00, 0x00, 0xc0, 0xc0, 0xcc, 0xcc, 0x30, 0x30, 0xcc, 0xcc, + 0x3c, 0x3c, 0x3c, 0x3c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, + 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0x33, 0x33, + 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, + 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, + 0xcc, 0xcc, 0xcc, 0xcc, 0x33, 0x33, 0x33, 0x33, 0xcc, 0xcc, 0xcc, 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, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0x30, 0x30, + 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3f, 0x3f, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0xff, 0xff, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x3f, 0x3f, 0x30, 0x30, 0x3f, 0x3f, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0xcf, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcf, 0xcf, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xc0, 0xcf, 0xcf, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0xcf, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0xcf, 0xcf, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0xcf, 0xc0, 0xc0, 0xcf, 0xcf, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcf, 0xcf, 0x00, 0x00, 0xcf, 0xcf, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0x30, 0x30, 0x30, 0x30, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, + 0x3f, 0x3f, 0x30, 0x30, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x30, 0x30, 0x3f, 0x3f, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xff, 0xff, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0x30, 0x30, 0x30, 0x30, 0xff, 0xff, 0x30, 0x30, 0xff, 0xff, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x33, 0x33, 0xcc, 0xcc, 0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0xcc, 0x30, 0x30, 0x00, 0x00, 0x0c, 0x0c, 0x30, 0x30, + 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0x30, 0x30, 0xc0, 0xc0, + 0x30, 0x30, 0xfc, 0xfc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xfc, 0xfc, 0x30, 0x30, 0x3c, 0x3c, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xfc, + 0xc0, 0xc0, 0xc0, 0xc0, 0x3c, 0x3c, 0x00, 0x00, 0x30, 0x30, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0xfc, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0xfc, 0xfc, 0x30, 0x30, + 0x30, 0x30, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0xc0, 0xc0, 0x30, 0x30, + 0x0c, 0x0c, 0x30, 0x30, 0xc0, 0xc0, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, + 0x0c, 0x0c, 0x30, 0x30, 0xc0, 0xc0, 0x30, 0x30, 0x0c, 0x0c, 0x00, 0x00, + 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x33, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x30, 0x30, + 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0xcc, 0xcc, 0x00, 0x00, + 0x33, 0x33, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xcc, 0xcc, + 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x30, 0xfc, 0xfc, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x3c, 0x3c, 0x0c, 0x0c, 0x00, 0x00, + 0x30, 0x30, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x0c, 0x0c, 0x30, 0x30, 0xc0, 0xc0, + 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, + 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; From 4246dbe6038de12408a0994373c0a3c1a06d938f Mon Sep 17 00:00:00 2001 From: Josh Renaud Date: Mon, 17 Feb 2025 19:45:53 -0600 Subject: [PATCH 2/4] First stab at Atari ST ANSIterm palette. Using colors from Palette #3 --- include/ansilove.h | 1 + src/config.h | 15 +++++++++++++++ src/loaders/ansi.c | 37 ++++++++++++++++++++++++------------- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/include/ansilove.h b/include/ansilove.h index 59a0a16..151282d 100644 --- a/include/ansilove.h +++ b/include/ansilove.h @@ -77,6 +77,7 @@ extern "C" { #define ANSILOVE_MODE_CED 1 #define ANSILOVE_MODE_TRANSPARENT 2 #define ANSILOVE_MODE_WORKBENCH 3 +#define ANSILOVE_MODE_ANSITERM 4 struct ansilove_png { uint8_t *buffer; diff --git a/src/config.h b/src/config.h index cfba93e..51ea0e4 100644 --- a/src/config.h +++ b/src/config.h @@ -55,6 +55,21 @@ static const uint8_t workbench_palette_blue[] = { 0xaa, 0x00, 0xff, 0xbb, 0xff, 0xff, 0xff, 0xff }; +static const uint8_t ansiterm_palette_red[] = { + 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, + 0x49, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF +}; + +static const uint8_t ansiterm_palette_green[] = { + 0x00, 0x00, 0x92, 0x6D, 0x00, 0x00, 0x92, 0x92, + 0x49, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF +}; + +static const uint8_t ansiterm_palette_blue[] = { + 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, + 0x49, 0x49, 0x00, 0x49, 0xFF, 0xFF, 0xFF, 0xFF +}; + static const uint8_t vga_palette_red[] = { 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c index eea5e23..d486808 100644 --- a/src/loaders/ansi.c +++ b/src/loaders/ansi.c @@ -119,6 +119,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) bool ced = false; bool workbench = false; + bool ansiterm = false; /* font selection */ memset(&fontData, 0, sizeof(struct fontStruct)); @@ -132,6 +133,10 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) workbench = true; break; } + case ANSILOVE_MODE_ANSITERM: + ansiterm = true; + break; + } /* ANSi buffer dynamic memory allocation */ ansi_buffer = malloc(ansi_buffer_size * sizeof(struct ansiChar)); @@ -199,10 +204,10 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) ansi_buffer[structIndex].foreground = background + (foreground & 8); } else { ansi_buffer[structIndex].background = - background24 ? background24 : background; + background24 ? background24 : background; ansi_buffer[structIndex].foreground = - foreground24 ? foreground24 : foreground; + foreground24 ? foreground24 : foreground; } ansi_buffer[structIndex].character = *cursor; ansi_buffer[structIndex].column = column; @@ -407,7 +412,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } if (seqValue == 1) { - if (!workbench) { + if (!workbench && !ansiterm) { foreground += 8; } bold = true; @@ -415,7 +420,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } if (seqValue == 5) { - if (!workbench && options->icecolors) + if (!workbench && !ansiterm && options->icecolors) background += 8; blink = true; @@ -539,8 +544,8 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) /* create that damn thingy */ canvas = options->truecolor ? - gdImageCreateTrueColor(width, height) : - gdImageCreate(width, height); + gdImageCreateTrueColor(width, height) : + gdImageCreate(width, height); if (!canvas) { ctx->error = ANSILOVE_GD_ERROR; @@ -556,16 +561,22 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } else if (workbench) { for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, - workbench_palette_red[i], - workbench_palette_green[i], - workbench_palette_blue[i]); + workbench_palette_red[i], + workbench_palette_green[i], + workbench_palette_blue[i]); + } else if (ansiterm) { + for (size_t i = 0; i < 16; i++) + colors[i] = gdImageColorAllocate(canvas, + ansiterm_palette_red[i], + ansiterm_palette_green[i], + ansiterm_palette_blue[i]); } else { /* Allocate standard ANSi color palette */ for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, - ansi_palette_red[i], ansi_palette_green[i], - ansi_palette_blue[i]); + ansi_palette_red[i], ansi_palette_green[i], + ansi_palette_blue[i]); } /* render ANSi */ @@ -589,8 +600,8 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } drawchar(canvas, fontData.font_data, options->bits, - fontData.height, column, row, background, foreground, - character); + fontData.height, column, row, background, foreground, + character); } /* create output image */ From 1a1f1c76b8f5381962c33c2d3cae3c23007d17ad Mon Sep 17 00:00:00 2001 From: Josh Renaud Date: Tue, 18 Feb 2025 18:17:08 -0600 Subject: [PATCH 3/4] Exceptions were unnecessasry for ansiterm --- src/loaders/ansi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c index d486808..48eac14 100644 --- a/src/loaders/ansi.c +++ b/src/loaders/ansi.c @@ -132,7 +132,6 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) case ANSILOVE_MODE_WORKBENCH: workbench = true; break; - } case ANSILOVE_MODE_ANSITERM: ansiterm = true; break; @@ -412,7 +411,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } if (seqValue == 1) { - if (!workbench && !ansiterm) { + if (!workbench) { foreground += 8; } bold = true; @@ -420,7 +419,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } if (seqValue == 5) { - if (!workbench && !ansiterm && options->icecolors) + if (!workbench && options->icecolors) background += 8; blink = true; From 06d5905e31dcb4ce0bd12303a7e5298f0189bc89 Mon Sep 17 00:00:00 2001 From: Josh Renaud Date: Wed, 19 Feb 2025 10:30:56 -0600 Subject: [PATCH 4/4] Revise Atari palettes. Now including ANSIterm 1, ANSIterm 3, and FANSI. --- include/ansilove.h | 6 ++++-- src/config.h | 50 ++++++++++++++++++++++++++++++++++++++++------ src/loaders/ansi.c | 34 ++++++++++++++++++++++++------- 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a/include/ansilove.h b/include/ansilove.h index 151282d..c139132 100644 --- a/include/ansilove.h +++ b/include/ansilove.h @@ -71,13 +71,15 @@ extern "C" { #define ANSILOVE_FONT_TOPAZ500_PLUS 37 /* Atari fonts */ -#define ANSILOVE_FONT_ANSITERM 40 +#define ANSILOVE_FONT_ANSITERM 40 /* Rendering modes */ #define ANSILOVE_MODE_CED 1 #define ANSILOVE_MODE_TRANSPARENT 2 #define ANSILOVE_MODE_WORKBENCH 3 -#define ANSILOVE_MODE_ANSITERM 4 +#define ANSILOVE_MODE_ANSITERM1 4 /* ANSIterm default palette (#1), muted high colors */ +#define ANSILOVE_MODE_ANSITERM3 5 /* ANSIterm palette #3, intense/saturated high colors */ +#define ANSILOVE_MODE_FANSI 6 /* FANSI default palette, slightly brighter, weird cyan */ struct ansilove_png { uint8_t *buffer; diff --git a/src/config.h b/src/config.h index 51ea0e4..e2d6d0c 100644 --- a/src/config.h +++ b/src/config.h @@ -25,6 +25,8 @@ #define PCB_COLORS 71 +/* ANSI palette */ + static const uint8_t ansi_palette_red[] = { 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x55, 0xff, 0x55, 0xff, 0x55, 0xff, 0x55, 0xff @@ -40,6 +42,8 @@ static const uint8_t ansi_palette_blue[] = { 0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff }; +/* Amiga palette */ + static const uint8_t workbench_palette_red[] = { 0xaa, 0x00, 0xff, 0x66, 0x00, 0xff, 0x00, 0xff, 0xaa, 0x00, 0xff, 0x66, 0x00, 0xff, 0x00, 0xff @@ -55,21 +59,55 @@ static const uint8_t workbench_palette_blue[] = { 0xaa, 0x00, 0xff, 0xbb, 0xff, 0xff, 0xff, 0xff }; -static const uint8_t ansiterm_palette_red[] = { +/* Three Atari ST palettes */ + +static const uint8_t ansiterm1_palette_red[] = { + 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0xB6, + 0x6D, 0xFF, 0x6D, 0xFF, 0x6D, 0xFF, 0x6D, 0xFF +}; + +static const uint8_t ansiterm1_palette_green[] = { + 0x00, 0x00, 0x92, 0x6D, 0x00, 0x00, 0x92, 0xB6, + 0x6D, 0x6D, 0xFF, 0xFF, 0x6D, 0x6D, 0xFF, 0xFF +}; + +static const uint8_t ansiterm1_palette_blue[] = { + 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0xB6, + 0x6D, 0x6D, 0x00, 0x6D, 0xFF, 0xFF, 0xFF, 0xFF +}; + +static const uint8_t ansiterm3_palette_red[] = { 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x49, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF }; -static const uint8_t ansiterm_palette_green[] = { - 0x00, 0x00, 0x92, 0x6D, 0x00, 0x00, 0x92, 0x92, +static const uint8_t ansiterm3_palette_green[] = { + 0x00, 0x00, 0x92, 0x6D, 0x00, 0x00, 0x92, 0x92, 0x49, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF }; -static const uint8_t ansiterm_palette_blue[] = { - 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, - 0x49, 0x49, 0x00, 0x49, 0xFF, 0xFF, 0xFF, 0xFF +static const uint8_t ansiterm3_palette_blue[] = { + 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, + 0x49, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF +}; + +static const uint8_t fansi_palette_red[] = { + 0x00, 0xB6, 0x00, 0xDB, 0x00, 0xB6, 0x00, 0xDB, + 0x92, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF +}; + +static const uint8_t fansi_palette_green[] = { + 0x00, 0x00, 0xB6, 0xB6, 0x00, 0x00, 0x92, 0xDB, + 0x92, 0x00, 0xFF, 0xFF, 0x00, 0x6D, 0xFF, 0xFF +}; + +static const uint8_t fansi_palette_blue[] = { + 0x00, 0x00, 0x00, 0x00, 0xB6, 0x92, 0xFF, 0xDB, + 0x92, 0x00, 0x00, 0x00, 0xFF, 0xB6, 0xFF, 0xFF }; +/* VGA palette */ + static const uint8_t vga_palette_red[] = { 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c index 48eac14..d26c174 100644 --- a/src/loaders/ansi.c +++ b/src/loaders/ansi.c @@ -119,7 +119,9 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) bool ced = false; bool workbench = false; - bool ansiterm = false; + bool ansiterm1 = false; + bool ansiterm3 = false; + bool fansi = false; /* font selection */ memset(&fontData, 0, sizeof(struct fontStruct)); @@ -132,8 +134,14 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) case ANSILOVE_MODE_WORKBENCH: workbench = true; break; - case ANSILOVE_MODE_ANSITERM: - ansiterm = true; + case ANSILOVE_MODE_ANSITERM1: + ansiterm1 = true; + break; + case ANSILOVE_MODE_ANSITERM3: + ansiterm3 = true; + break; + case ANSILOVE_MODE_FANSI: + fansi = true; break; } @@ -563,12 +571,24 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) workbench_palette_red[i], workbench_palette_green[i], workbench_palette_blue[i]); - } else if (ansiterm) { + } else if (ansiterm1) { + for (size_t i = 0; i < 16; i++) + colors[i] = gdImageColorAllocate(canvas, + ansiterm1_palette_red[i], + ansiterm1_palette_green[i], + ansiterm1_palette_blue[i]); + } else if (ansiterm3) { + for (size_t i = 0; i < 16; i++) + colors[i] = gdImageColorAllocate(canvas, + ansiterm3_palette_red[i], + ansiterm3_palette_green[i], + ansiterm3_palette_blue[i]); + } else if (fansi) { for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, - ansiterm_palette_red[i], - ansiterm_palette_green[i], - ansiterm_palette_blue[i]); + fansi_palette_red[i], + fansi_palette_green[i], + fansi_palette_blue[i]); } else { /* Allocate standard ANSi color palette */