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.80 1997/09/26 17:11:46 grubba Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.81 1997/09/26 17:39:18 grubba Exp $";   constant thread_safe=1;      #include <module.h>   inherit "module";   inherit "roxenlib";      #if efun(_static_modules)   # define map_array Array.map   import Image;   # define Image image
Roxen.git/server/modules/graphics/graphic_text.pike:43:    " bold Try to find a bold version of the font.\n"    " italic Try to find an italic version of the font.\n"    " black Try to find a black (heavy) version of the font.\n"    " light Try to find a light version of the font.\n"    " scale=float Scale to this font, mostly useful in the &lt;gtext&gt;\n"    " tag, will not work at all in the &lt;gh[number]&gt;\n"    " tags.\n"    " 2 3 4 5 6 Short for scale=1.0/([number]*0.6)\n"    " notrans Do _not_ make the background color transparent\n"    " split Make each word into a separate gif image\n" +  " split=char Split the string also at CHAR\n"    " 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"    " alt=message Sets the 'alt' attribute.\n"    " Use alt=\"\" if no alternate message is wanted.\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"    " fuzz[=color] Apply the 'glow' effect to the result\n"    " fs Use floyd-steinberg dithering\n"
Roxen.git/server/modules/graphics/graphic_text.pike:1020:    if(arg->help)    return register_module()[2];      #if efun(_static_modules)    contents = parse_rxml(contents, id, foo, defines);   #else    contents = parse_rxml(contents, id, foo);   #endif       string pre, post, defalign, gt, rest, magic; -  int i, split; +  int i; +  string split;       // No images here, let's generate an alternative..    if(!id->supports->images || id->prestate->noimages)    {    if(!arg->split) contents=replace(contents,"\n", "\n<br>\n");    if(arg->submit) return "<input type=submit name=\""+(arg->name+".x")+"\" value=\""+contents+"\">";    switch(t)    {    case "gtext":    case "anfang":
Roxen.git/server/modules/graphics/graphic_text.pike:1092:    ||QUERY(default_font)   #endif    ;    if(!arg->bold) arg->bold=defines->bold;    if(!arg->italic) arg->italic=defines->italic;    if(!arg->black) arg->black=defines->black;    if(!arg->narrow) arg->narrow=defines->narrow;       if(arg->split)    { -  split=1; +  if (sizeof(split=arg->split) != 1) { +  split = " "; +  }    m_delete(arg,"split");    }       // Support for <gh 2> like things.    for(i=2; i<10; i++)    if(arg[(string)i])    {    arg->scale = 1.0 / ((float)i*0.6);    m_delete(arg, (string)i);    break;
Roxen.git/server/modules/graphics/graphic_text.pike:1144:    string word;    array res = ({pre});    string pre = query_location()+num+"/";       if(lp) res+=({ lp });       gt=replace(gt, "\n", " ");       foreach(gt/" "-({""}), word)    { +  if (split != " ") { +  array arr = word/split; +  int i; +  for (i = sizeof(arr)-1; i--;) { +  arr[i] += split; +  } +  if (arr[-1] == "") { +  arr = arr[..sizeof(arr)-2]; +  } +  foreach (arr, word) {    array size = write_text(num,word,1,id);    res += ({ "<img _parsed=1 border=0 alt=\""+replace(word,"\"","'")    +"\" src=\""+pre+quote(word)+"\" width="+    size[0]+" height="+size[1]+" "+ea+">\n"    });    } -  +  } else { +  array size = write_text(num,word,1,id); +  res += ({ "<img _parsed=1 border=0 alt=\""+replace(word,"\"","'") +  +"\" src=\""+pre+quote(word)+"\" width="+ +  size[0]+" height="+size[1]+" "+ea+">\n" +  }); +  } +  }    if(lp) res+=({ "</a>"+post });    return res*"";    }       array size = write_text(num,gt,1,id);    if(!size) {    return ("<font size=+1><b>Missing font or other similar error -- "    "failed to render text</b></font>");    }    if(magic)