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.5 2000/09/04 07:40:51 per Exp $"; + constant cvs_version = "$Id: ttf.pike,v 1.6 2000/10/21 18:46:50 per 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:113:       // nbsp -> ""    what = map( (array(string))what, replace, " ", "" );       // cannot write "" with Image.TTF.    what = replace( what, "", " " );       array(Image.Image) res = map( what, real_write );       Image.Image rr = Image.Image( max(0,@res->xsize()), -  (int)abs(`+(0,@res->ysize())*y_spacing) ); +  (int)abs(`+(0,0,@res[..sizeof(res)-2]->ysize())*y_spacing)+res[-1]->ysize() );       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 ); +  rr->paste_alpha_color( r, 255,255,255, rr->xsize()-r->xsize(), (int)start );    else if( j_center ) -  rr->paste( r, (rr->xsize()-r->xsize())/2, (int)start ); +  rr->paste_alpha_color( r, 255,255,255,(rr->xsize()-r->xsize())/2, (int)start );    else -  rr->paste( r, 0, (int)start ); +  rr->paste_alpha_color( r, 255,255,255, 0, (int)start );    start += r->ysize()*y_spacing;    }    return rr->scale(0.5);    }       array text_extents( string what )    {    Image.Image o = write( what );    return ({ o->xsize(), o->ysize() });    }