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.175 1999/05/19 07:07:09 peter Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.176 1999/05/25 09:48:17 per Exp $";   constant thread_safe=1;      #include <config.h>   #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0
Roxen.git/server/modules/graphics/graphic_text.pike:551:      mixed draw_callback(mapping args, object id)   {    array err;    mixed data;    int elapsed;    string text = args->text;    string orig_text = text;    object img;    -  m_delete( args, "text" ); -  -  if(!sizeof(args)) -  { -  args=(["fg":"black","bg":"white","notrans":"1"]); -  text="Please reload this page"; -  } -  //werror("Not cached: %O -> %O\n", key, text); -  //werror("In cache: %O\n", sort(indices(cache->cache))); -  +     if(!args->verbatim) // typographically correct...    {    text = replace(text, nbsp, " ");    text = simplify_text( text );    string res="",nspace="",cspace="";    foreach(text/"\n", string line)    {    cspace="";nspace="";    foreach(line/" ", string word)    {
Roxen.git/server/modules/graphics/graphic_text.pike:870:    if(defines->nfont && !arg->nfont) arg->nfont=defines->nfont;    if(defines->afont && !arg->afont) arg->afont=defines->afont;    if(defines->font && !arg->font) arg->font=defines->font;    if(defines->bold && !arg->bold) arg->bold=defines->bold;    if(defines->italic && !arg->italic) arg->italic=defines->italic;    if(defines->black && !arg->black) arg->black=defines->black;    if(defines->narrow && !arg->narrow) arg->narrow=defines->narrow;       if(arg->split)    { -  if (sizeof(split=arg->split) != 1) +  if ((split=arg->split) == "split")    split = " ";    m_delete(arg,"split");    }       // Support for <gh 2> like things.    for(i=2; i<10; i++)    if(arg[(string)i])    {    arg->scale = (string)(1.0 / ((float)i*0.6));    m_delete(arg, (string)i);
Roxen.git/server/modules/graphics/graphic_text.pike:922:    array res = ({ pre });    if(lp) res+=({ lp });       gt=replace(gt, "\n", " ");       foreach(gt/split-({""}), word)    {    arg->text = word;    string fn = image_cache->store( arg );    mapping size = image_cache->metadata( fn, id, 1 ); -  +     mapping tag =    ([    "alt":(arg->alt||word),    "src":query_internal_location()+fn+gif,    ]);    if( size )    { -  tag->width = size->xsize; -  tag->height = size->ysize; +  tag->width = (string)size->xsize; +  tag->height = (string)size->ysize;    }    res += ({ make_tag( "img", tag )+" " });    }    if(lp) res += ({ "</a>"+post });    return res*"";    }       arg->text = gt;    string num = image_cache->store( arg );    mapping size = image_cache->metadata( arg, id, 1 );