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.166 1999/03/11 23:07:24 mast Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.167 1999/05/08 00:52:43 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:110:       defvar("default_font", "urw_itc_avant_garde-demi-r", "Default font",    TYPE_STRING_LIST,    "The default font. The 'font dir' will be prepended to the path",    list_fonts());   #endif   }      string query_location() { return query("location"); }    - object load_font(string name, string justification, int xs, int ys) - { -  object fnt = Image.font(); -  -  if ((!name)||(name == "")) -  { -  return get_font("default",32,0,0,lower_case(justification||"left"), -  (float)xs, (float)ys); -  } else if(sscanf(name, "%*s/%*s") != 2) { -  name=QUERY(default_size)+"/"+name; -  } -  -  name = "fonts/" + name; -  -  if(!fnt->load( name )) -  { -  report_debug("Failed to load the compatibility font "+name+ -  ", using the default font.\n"); -  return get_font("default",32,0,0,lower_case(justification||"left"), -  (float)xs, (float)ys); -  } -  catch -  { -  if(justification=="right") fnt->right(); -  if(justification=="center") fnt->center(); -  if(xs)fnt->set_x_spacing((100.0+(float)xs)/100.0); -  if(ys)fnt->set_y_spacing((100.0+(float)ys)/100.0); -  }; -  return fnt; - } -  +    static private mapping cached_args = ([ ]);      #define MAX(a,b) ((a)<(b)?(b):(a))      #if !efun(make_matrix)   static private mapping (int:array(array(int))) matrixes = ([]);   array (array(int)) make_matrix(int size)   {    if(matrixes[size]) return matrixes[size];    array res;