Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - constant cvs_version="$Id: graphic_text.pike,v 1.130 1998/06/09 10:57:21 peter Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.131 1998/07/04 03:19:51 peter Exp $";   constant thread_safe=1;      #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0   #endif /* VAR_MORE */
Roxen.git/server/modules/graphics/graphic_text.pike:39:    return ({});    }    return fnts;   }      void create()   {    defvar("cache_dir", "../gtext_cache", "Cache directory for gtext images",    TYPE_DIR,    "The gtext tag saves images when they are calculated in this " -  "directory. We currently do not clean this directory."); +  "directory.");       defvar("cache_age", 48, "Cache max age",       TYPE_INT,       "If the images in the cache have not been accessed for this "    "number of hours they are removed.");       defvar("speedy", 0, "Avoid automatic detection of document colors",    TYPE_FLAG|VAR_MORE,
Roxen.git/server/modules/graphics/graphic_text.pike:468:    }       background->setcolor(@bgcolor);       if(args->size || args->xsize || args->ysize)    {    int xs=background->xsize(), ys=background->ysize();    if(args->size) { xs=(int)args->size; ys=(int)(args->size/",")[-1]; }    if(args->xsize) xs=(int)args->xsize;    if(args->ysize) ys=(int)args->ysize; -  background = background->copy(0,0,xs,ys); +  if(!args->rescale) +  background = background->copy(0,0,xs-1,ys-1); +  else +  background = background->scale(xs, ys);    }    -  +     if(args->turbulence)    {    array (float|array(int)) arg=({});    foreach((args->turbulence/";"), string s)    {    array q= s/",";    if(sizeof(q)<2) args+=({ ((float)s)||0.2, ({ 255,255,255 }) });    arg+=({ ((float)q[0])||0.2, parse_color(q[1]) });    }    background=background->turbulence(arg);
Roxen.git/server/modules/graphics/graphic_text.pike:573:    string c1="black",c2="black",c3="black",c4="black";    sscanf(args->textscale, "%s,%s,%s,%s", c1, c2, c3, c4);    foreground->tuned_box(0,0, txsize,tysize,    ({parse_color(c1),parse_color(c2),parse_color(c3),    parse_color(c4)}));    }    if(args->outline)    outline(background, text_alpha, parse_color((args->outline/",")[0]),    ((int)(args->outline/",")[-1])+1, xoffset, yoffset);    +  if(args->textbelow) +  { +  array color = parse_color(args->textbelow); + // foreground = foreground->autocrop(); + // text_alpha = text_alpha->autocrop(); +  +  background->setcolor( @color ); +  int oby = background->ysize(); +  background = background->copy(0,0, +  max(background->xsize()-1, +  foreground->xsize()-1), +  background->ysize()-1 +  +foreground->ysize()); +  background->paste_mask( foreground, text_alpha, +  (background->xsize()-foreground->xsize())/2, +  oby ); +  } else    background->paste_mask(foreground, text_alpha, xoffset, yoffset);    -  if(args->scale) +  if((float)args->scale>0.0)    if((float)args->scale <= 2.0)    background = background->scale((float)args->scale);          foreground = text_alpha = 0;          if(args->rotate)    {    string c;