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

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - string cvs_version="$Id: graphic_text.pike,v 1.8 1996/12/10 01:59:35 per Exp $"; + string cvs_version="$Id: graphic_text.pike,v 1.9 1996/12/10 02:56:50 per Exp $";   #include <module.h>   inherit "module";   inherit "roxenlib";         array register_module()   {    return ({ MODULE_LOCATION | MODULE_PARSER,    "Graphics text",    "Makes a few new tags:<p>"
Roxen.git/server/modules/graphics/graphic_text.pike:34:    " href=url Link the image to the specified URL\n"    " The 'link' color of the document will be\n"    " used as the default foreground of the text\n"    " quant=cols Use this number of colors\n"    " magic[=message] Modifier to href, more flashy links\n"    " Does <b>not</b> work with 'split'\n"    " fs Use floyd-steinberg dithering\n"    " border=int,#col Draw an border (width is the first argument\n"    " in the specified color\n"    " spacing=int Add this amount of spacing around the text\n" +  " xspacing=int like spacing, but only horizontal\n" +  " yspacing=int like spacing, but only vertical\n" +  " size=int,int Use this (absolute) size\n" +  " xsize=int Use this (absolute) size\n" +  " ysize=int Use this (absolute) size\n"    " bevel=int Draw a bevel box (width is the argument)\n"    " pressed Invert the \"direction\" of the bevel box\n"    " talign=dir Justify the text to the left, right, or center\n"    " textbox=al,#col Use 'al' as opaque value to draw a box below\n"    " the text with the specified color.\n"    " xpad=X% Increase padding between characters with X%\n"    " xpad=Y% Increase padding between lines with Y%\n"    " shadow=int,dist Draw a drop-shadow (variable distance/intensity)\n"    " fuzz=#col The 'shine' effect used in the 'magic'\n"    " highlightning\n"
Roxen.git/server/modules/graphics/graphic_text.pike:285:    object background,foreground;          if(args->texture) foreground = load_image(args->texture);       if(args->background)    {    background = load_image(args->background);    xsize = background->xsize();    ysize = background->ysize(); -  switch(lower_case(args->talign)) +  switch(lower_case(args->talign||"left"))    {    case "center":    xoffset = (xsize/2 - txsize/2);    break;    case "right":    xoffset = (xsize - txsize);    break;    case "left":    }    } else    background = Image(xsize, ysize, @bgcolor); -  +  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,xsize,ysize); +  }    -  +     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:393:    return data[0];    }       // Nothing found in the cache. Generate a new image.       data = cache_lookup("fonts:fonts",    args->font+args->justift+":"+    args->xpad+":"+args->ypad);    if(!data)    { -  data = load_font(args->font, lower_case(args->talign||""),(int)args->xpad,(int)args->ypad); +  data = load_font(args->font, lower_case(args->talign||"left"),(int)args->xpad,(int)args->ypad);    cache_set("fonts:fonts", args->font, data);    }       // Fonts and such are now initialized.       img = make_text_image(args,data,text);       // Now we have the image in 'img', or nothing.       if(!img) return 0;