From: Mikko Rasa Date: Fri, 23 Nov 2012 08:43:08 +0000 (+0200) Subject: Add an option to invert colors X-Git-Tag: 1.0~12 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a63e33344928b7f767b97aced995a84ad9b53de0;p=ttf2png.git Add an option to invert colors --- 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