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

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1:   // This is a ChiliMoon module. Copyright © 1996 - 2001, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.303 2004/05/31 23:01:52 _cvs_stephen Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.304 2004/06/03 23:15:05 mani Exp $";      #include <module.h>   inherit "module";         // ------------------- Module registration ---------------------      constant module_type = MODULE_TAG;   constant module_name = "Graphics: Graphic text";   constant module_doc =
Roxen.git/server/modules/graphics/graphic_text.pike:554: Inside #if defined(manual)
   Returns a relative path to the image, i.e. a shorter one.   </p>   </attr>   <noex>"+gtextargs+"</noex>",]);   #endif         // -------------------- Image cache functions --------------------      private core.ImageCache image_cache; - private string compat_level; +       string status() {    array s=image_cache->status();    return sprintf("<b>Images in cache:</b> %d images<br />\n"    "<b>Cache size:</b> %s",    s[0], String.int2size(s[1]));   }      mapping(string:function) query_action_buttons() {    return ([ "Clear cache":flush_cache ]);
Roxen.git/server/modules/graphics/graphic_text.pike:576:      void flush_cache() {    image_cache->flush();   }      void start(int num, Configuration conf)   {    image_cache = core.ImageCache( "gtext", draw_callback );    core.dump( "etc/modules/GText.pmod" );    if(query("colorparse")) module_dependencies(conf, ({ "wiretap" }) ); -  compat_level = conf->query("compat_level"); +    }      private constant nbsp = Roxen.iso88591["&nbsp;"];      private Image.Image|mapping draw_callback(mapping args, string text, RequestID id)   {    array data;    Image.Font font;    Image.Image img;   
Roxen.git/server/modules/graphics/graphic_text.pike:838:   });      private constant theme = ({ "fgcolor", "bgcolor", "font" });      private constant hreffilter = ([ "split":1, "magic":1, "noxml":1, "alt":1 ]);      private mapping mk_gtext_arg(mapping arg, RequestID id)   {    mapping p=([]); //Picture rendering arguments.    - #if ROXEN_COMPAT < 2.2 -  if(compat_level < "2.2") { -  p->compat = compat_level; -  p->font = m_delete(arg, "nfont"); -  } - #endif -  +     m_delete(arg,"src");    m_delete(arg,"width");    m_delete(arg,"height");       // Make format selection explicit since fallback may vary depending on    // encoders present in this installation.    if (!arg->format)    arg->format = "png";      #if !constant(Image.GIF) || !constant(Image.GIF.encode)
Roxen.git/server/modules/graphics/graphic_text.pike:893:    }    }       foreach(theme, string tmp)    if( (id->misc->defines[tmp] || id->misc->defines["theme_"+tmp]) && !p[tmp])    p[tmp]=id->misc->defines["theme_"+tmp] || id->misc->defines[tmp];       if(!p->fgcolor) p->fgcolor="#000000";    if(!p->bgcolor) p->bgcolor="#ffffff";    - #if ROXEN_COMPAT < 2.2 -  if(id->misc->defines->nfont && !p->nfont && !p->font && !p->afont && compat_level<"2.2") -  p->font=id->misc->gtext_nfont; - #endif +     if(id->misc->defines->afont && !p->nfont && !p->font && !p->afont)    p->afont=id->misc->gtext_afont;    if(id->misc->defines->bold && !p->bold) p->bold=id->misc->gtext_bold;    if(id->misc->defines->italic && !p->italic) p->italic=id->misc->gtext_italic;    if(id->misc->defines->black && !p->black) p->black=id->misc->gtext_black;    if(id->misc->defines->narrow && !p->narrow) p->narrow=id->misc->gtext_narrow;       if(p->afont) {    p->font = core->fonts->verify_font( p->afont+" "+p->fontsize );    if(!p->font) RXML.parse_error("Font "+p->afont+" could not be loaded.\n");