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.65 1997/09/03 18:49:27 grubba Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.66 1997/09/04 12:40:02 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:626:    {    object img;    mapping args = find_cached_args(_args);    if(!args)    {    args=(["fg":"black","bg":"white"]);    text="Please reload this page";    }    if(!args->verbatim)    { -  string res="",nspace="",cspace="", nonum; +  string res="",nspace="",cspace="";    foreach(text/"\n", string line)    {    cspace="";nspace="";    foreach(line/" ", string word)    { -  +  string nonum;    if(strlen(word) && -  (nonum=replace(word,({"1","2","3","4","5","6","7","8","9","0","."}), -  ({"","","","","","","","","","",""}))) -  =="") +  (nonum = replace(word, +  ({"1","2","3","4","5","6","7","8","9","0","."}), +  ({"","","","","","","","","","",""}))) == "") {    cspace=nbsp+nbsp; -  else if(cspace!="") -  cspace=" "; -  if((strlen(word)-strlen(nonum)<strlen(word)/2) && (upper_case(word) == word)) +  if((strlen(word)-strlen(nonum)<strlen(word)/2) && +  (upper_case(word) == word)) {    word=((word/"")*nbsp); -  +  } +  } else if(cspace!="") { +  cspace=" "; +  }    res+=(nspace==cspace?nspace:" ")+word;       if(cspace!="") nspace=cspace;    else nspace=" ";    }    res+="\n";    }    text = replace(res[..strlen(res)-2], ({ "!","?",": " }), ({ nbsp+"!",nbsp+"?",nbsp+": " }));    text = replace(replace(replace(text,({". ",". "+nbsp}), ({"\000","\001"})),".","."+nbsp+nbsp),({"\000","\001"}),({". ","."+nbsp}));    }