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.6 2000/10/21 18:46:47 per Exp $"; + constant cvs_version = "$Id: ttf.pike,v 1.7 2000/12/11 05:12:55 nilsson Exp $";      constant name = "TTF fonts";   constant doc = "True Type font loader. Uses freetype to render text.";   constant scalable = 1;      inherit FontHandler;      static mapping ttf_font_names_cache;      static string trimttfname( string n )
Roxen.git/server/font_handlers/ttf.pike:129:    foreach( res, object r )    {    if( j_right )    rr->paste_alpha_color( r, 255,255,255, rr->xsize()-r->xsize(), (int)start );    else if( j_center )    rr->paste_alpha_color( r, 255,255,255,(rr->xsize()-r->xsize())/2, (int)start );    else    rr->paste_alpha_color( r, 255,255,255, 0, (int)start );    start += r->ysize()*y_spacing;    } -  return rr->scale(0.5); +  return rr;    }       array text_extents( string what )    {    Image.Image o = write( what );    return ({ o->xsize(), o->ysize() });    }       void create(object r, int s, string fn)    {    string encoding;    real = r;    size = s; -  real->set_height( (int)(size*64/34.5) ); // aproximate to pixels +  real->set_height( (int)(size*32/34.5) ); // aproximate to pixels       if(r_file_stat(fn+".properties"))    parse_html(lopen(fn+".properties","r")->read(), ([]),    (["encoding":lambda(string tag, mapping m, string enc) {    encoding = enc;    }]));       if(encoding)    encoder = Locale.Charset.encoder(encoding, "");