Roxen.git / server / font_handlers / ttf.pike

version» Context lines:

Roxen.git/server/font_handlers/ttf.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2000, Roxen IS.      #if constant(has_Image_TTF)   #include <config.h> - constant cvs_version = "$Id: ttf.pike,v 1.3 2000/09/04 05:09:44 per Exp $"; + constant cvs_version = "$Id: ttf.pike,v 1.4 2000/09/04 06:49:35 per Exp $";      constant name = "TTF fonts";   constant doc = "True Type font loader.";   constant scalable = 1;      inherit FontHandler;      static mapping ttf_font_names_cache;      static string trimttfname( string n )
Roxen.git/server/font_handlers/ttf.pike:158:    encoding = enc;    }]));       if(encoding)    encoder = Locale.Charset.encoder(encoding, "");       real_write = (encoder? write_encoded : real->write);    }   }    + #ifdef THREADS + Thread.Mutex lock = Thread.Mutex(); + #endif +    array available_fonts()   { -  + #ifdef THREADS +  object key = lock->lock(); + #endif    if( !ttf_font_names_cache ) build_font_names_cache( );    return indices( ttf_font_names_cache );   }      array(mapping) font_information( string font )   {    if( !has_font( font, 0 ) )    return ({});       mapping res = ([
Roxen.git/server/font_handlers/ttf.pike:186:    else    f = Image.TTF( (font=values(ttf_font_names_cache[ font ])[0]) );       res->path = font;    res |= f->names();    return ({ res });   }      array(string) has_font( string name, int size )   { + #ifdef THREADS +  object key = lock->lock(); + #endif    if( !ttf_font_names_cache )    build_font_names_cache( );    if( ttf_font_names_cache[ name ] )    return indices(ttf_font_names_cache[ name ]);   }      Font open(string f, int size, int bold, int italic )   {    string tmp;    int|string style = font_style( f, size, bold, italic );