From a63e33344928b7f767b97aced995a84ad9b53de0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 23 Nov 2012 10:43:08 +0200 Subject: [PATCH] Add an option to invert colors --- ttf2png.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ttf2png.c b/ttf2png.c index b61d51d..c77cd58 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -73,6 +73,7 @@ int main(int argc, char **argv) char autohinter = 0; char seq = 0; char alpha = 0; + char invert = 0; char pack = 0; FT_Library freetype; @@ -92,7 +93,7 @@ int main(int argc, char **argv) return 1; } - while((i = getopt(argc, argv, "r:s:l:c:o:atvh?ed:p")) != -1) + while((i = getopt(argc, argv, "r:s:l:c:o:atvh?ed:pi")) != -1) { char *ptr; int temp; @@ -175,6 +176,9 @@ int main(int argc, char **argv) case 'p': pack = 1; break; + case 'i': + invert = 1; + break; } } if(!strcmp(out_fn, "-")) @@ -224,6 +228,11 @@ int main(int argc, char **argv) render_packed(&font); else render_grid(&font, cellw, cellh, cpl, seq); + if(invert) + { + for(i=0; i