Roxen.git / server / font_handlers / imagedir.pike

version» Context lines:

Roxen.git/server/font_handlers/imagedir.pike:1:   #include <config.h>   #include <stat.h> - constant cvs_version = "$Id: imagedir.pike,v 1.8 2001/01/02 18:30:00 nilsson Exp $"; + constant cvs_version = "$Id: imagedir.pike,v 1.9 2001/01/02 18:56:35 nilsson Exp $";      constant name = "Image directory fonts";   constant doc = ("Handles a directory with images (in almost any format), each "    "named after the character they will represent. Characters "    "with codes larger than 127 or less than 48 are encoded like "    "0xHEX where HEX is the code in hexadecimal. There must be a "    "file named 'fontname' in the directory, the first line of "    "that file is used as the name of the font");      inherit FontHandler;
Roxen.git/server/font_handlers/imagedir.pike:105:       Image.Image write( string ... what )    {    array(Image.Image) res = map( what, write_row );    Image.Image rr;    if(floatp(y_spacing))    rr = Image.Image( max(0,@res->xsize()),    (int)abs(`+(0,@res->ysize())*y_spacing) );    else    rr = Image.Image( max(0,@res->xsize()), -  abs(`+(0,@res->ysize())+(sizeof(res)+y_spacing)) ); +  abs(`+(0,@res->ysize())+(sizeof(res)*y_spacing)) );       float start;    if( y_spacing < 0 ) start = (float)rr->ysize()-res[0]->ysize();       foreach( res, object r )    {    if( j_right ) rr->paste(r,rr->xsize()-r->xsize(),(int)start);    else if( j_center ) rr->paste(r,(rr->xsize()-r->xsize())/2,(int)start);    else rr->paste( r, 0, (int)start );    if(floatp(y_spacing))
Roxen.git/server/font_handlers/imagedir.pike:173:    what=(lower_case( replace(what," ","_") )/"\n")[0]-"\r";    if(sizeof(_meta_data)) meta_data[what]=_meta_data;    return what;   }      void update_font_list()   {    font_list = ([]);    foreach(roxen->query("font_dirs"), string dir)    foreach( (get_dir( dir )||({})), string d ) -  if( file_stat( dir+d )[ ST_SIZE ] == -2 ) // isdir -  if( file_stat( dir+d+"/fontname" ) ) +  if( file_stat( dir+d )[ ST_SIZE ] == -2 ) { // isdir +  if( file_stat( dir+d+"/fontinfo" ) ) +  font_list[font_name(Stdio.read_bytes(dir+d+"/fontinfo"))]=dir+d+"/"; +  else if( file_stat( dir+d+"/fontname" ) )    font_list[font_name(Stdio.read_bytes(dir+d+"/fontname"))]=dir+d+"/";    } -  + }      array available_fonts()   {   #ifdef THREADS    object key = lock->lock();   #endif    array res = ({});    if( !font_list ) update_font_list();    return indices( font_list );   }