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.149 1998/08/28 17:43:48 js Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.150 1998/09/11 22:18:30 per Exp $";   constant thread_safe=1;      #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0   #endif /* VAR_MORE */
Roxen.git/server/modules/graphics/graphic_text.pike:846:    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}));    }      // cache_set(key, text, "rendering");    + #if efun(resolve_font) +  if(args->afont) +  { +  data = resolve_font(args->afont); +  } +  else + #endif    if(args->nfont)    {    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 if(args->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); +  data = resolve_font(args->font);    if(!data)    data = load_font(args->font, lower_case(args->talign||"left"),    (int)args->xpad,(int)args->ypad); -  } -  else if(args->afont) -  { - #if efun(resolve_font) -  data = resolve_font(args->afont); - #endif +     } 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(roxen->QUERY(default_font),32,bold,italic,    lower_case(args->talign||"left"),    (float)(int)args->xpad, (float)(int)args->ypad);    }
Roxen.git/server/modules/graphics/graphic_text.pike:1099:    }   }      void save_cached_args()   {    int on;    on = number;    if(!args_restored) restore_cached_args();    if(on > number) number=on;    object o = open(ARGHASH, "wct"); +  if(o) +  {   #ifndef __NT__   #if efun(chmod)    // FIXME: Should this error be propagated?    catch { chmod( ARGHASH, 0666 ); };   #endif   #endif    string data=encode_value(cached_args);    catch {    object q;    if(sizeof(indices(q=Gz)))    data=q->deflate()->deflate(data);    };    o->write(data);    } -  + }      mapping find_cached_args(int num)   {    if(!args_restored) restore_cached_args();    if(cached_args[num]) return cached_args[num];    restore_cached_args(); /* Not slow anymore, checks with stat... */    if(cached_args[num]) return cached_args[num];    return 0;   }   
Roxen.git/server/modules/graphics/graphic_text.pike:1229:   string tag_gtext_id(string t, mapping arg,    object id, object foo, mapping defines)   {    int short=!!arg->short;    if(arg->help) return "Arguments are identical to the argumets to &lt;gtext&gt;. This tag returns a url-prefix that can be used to generate gtexts.";    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 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(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(arg->background)    arg->background = fix_relative(arg->background,id);    if(arg->texture)    arg->texture = fix_relative(arg->texture,id);    if(arg->magic_texture)    arg->magic_texture=fix_relative(arg->magic_texture,id);    if(arg->magic_background)    arg->magic_background=fix_relative(arg->magic_background,id);    if(arg->magicbg)
Roxen.git/server/modules/graphics/graphic_text.pike:1333:    if(arg->href)    {    url = arg->href;    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(!arg->nfont) arg->nfont=defines->nfont; -  if(!arg->font) arg->font=defines->font; -  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(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)    split = " ";    m_delete(arg,"split");    }       // Support for <gh 2> like things.    for(i=2; i<10; i++)