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.62 1997/09/03 00:31:42 per Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.63 1997/09/03 05:16:34 per 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:221:   object load_image(string f,object id)   {    if(last_image_name == f && last_image) return last_image->copy();    string data;    object file;    object img = Image();       if(!(data=roxen->try_get_file(fix_relative(f, id),id)))    if(!(file=open(f,"r")) || (!(data=file->read())))    return 0; -  werror("Read "+strlen(data)+" bytes.\n"); + //werror("Read "+strlen(data)+" bytes.\n");    if(!img->frompnm(data)) return 0;    last_image = img; last_image_name = f;    return img->copy();   }      object (Image) blur(object img, int amnt)   {    img->setcolor(0,0,0);    img = img->autocrop(amnt, 0,0,0,0, 0,0,0);   
Roxen.git/server/modules/graphics/graphic_text.pike:637: Inside #if efun(get_font)
   {    int bold, italic;    if(args->bold) bold=1;    if(args->light) bold=-1;    if(args->italic) italic=1;    if(args->black) bold=2;    data = get_font(args->nfont,(int)args->font_size||32,bold,italic,    lower_case(args->talign||"left"),    (float)(int)args->xpad, (float)(int)args->ypad);    } -  else - #endif +  else if(args->font)    { -  + #endif    string fkey = args->font+"/"+args->talign+"/"+args->xpad+"/"+args->ypad;    data = cache_lookup("fonts", fkey);    if(!data)    {    data = load_font(args->font, lower_case(args->talign||"left"),    (int)args->xpad,(int)args->ypad);    cache_set("fonts", fkey, data);    } -  + #if efun(get_font) +  } else { +  int bold, italic; +  if(args->bold) bold=1; +  if(args->light) bold=-1; +  if(args->italic) italic=1; +  if(args->black) bold=2; +  data = get_font("default",32,bold,italic, +  lower_case(args->talign||"left"), +  (float)(int)args->xpad, (float)(int)args->ypad);    } -  + #endif       // Fonts and such are now initialized.    img = make_text_image(args,data,text,id);       // Now we have the image in 'img', or nothing.    if(!img) return 0;       int q = (int)args->quant||(args->background||args->texture?250:QUERY(cols));       if(q>255) q=255;
Roxen.git/server/modules/graphics/graphic_text.pike:861:      string tag_gtext_id(string t, mapping arg,    object id, object foo, mapping defines)   {    int short=!!arg->short;    m_delete(arg, "short"); m_delete(arg, "maxlen");    m_delete(arg,"magic"); m_delete(arg,"submit");    extra_args(arg); m_delete(arg,"split");    if(defines->fg && !arg->fg) arg->fg=defines->fg;    if(defines->bg && !arg->bg) arg->bg=defines->bg; -  if(!arg->font) arg->font=defines->font||QUERY(default_font); +    #if efun(get_font)    if(!arg->nfont) arg->nfont=defines->nfont;   #endif -  +  if(!arg->font) arg->font=defines->font + #if !efun(get_font) +  ||QUERY(default_font) + #endif +  ;       int num = find_or_insert( arg );       if(!short)    return query_location()+num+"/";    else    return (string)num;   }      string tag_graphicstext(string t, mapping arg, string contents,
Roxen.git/server/modules/graphics/graphic_text.pike:950:    lp = "<a href=\""+arg->href+"\" "+ea+">";    if(!arg->fg) arg->fg=defines->link||"#0000ff";    m_delete(arg, "href");    }       if(defines->fg && !arg->fg) arg->fg=defines->fg;    if(defines->bg && !arg->bg) arg->bg=defines->bg;   #if efun(get_font)    if(!arg->nfont) arg->nfont=defines->nfont;   #endif +  if(!arg->font) arg->font=defines->font + #if !efun(get_font) +  ||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->font) arg->font=defines->font||QUERY(default_font); +        if(arg->split)    {    split=1;    m_delete(arg,"split");    }       // Support for <gh 2> like things.    for(i=2; i<10; i++)    if(arg[(string)i])