2002-08-16
2002-08-16 13:55:50 by Mattias Andersson <matan@lysator.liu.se>
-
449d24832b8a9ee226cf94095652ff3855ef426c
(14 lines)
(+10/-4)
[
Show
| Annotate
]
Branch: 5.2
Added a variable to toggle the font oversampling.
Rev: server/font_handlers/ttf.pike:1.14
4: Inside #if !constant(Image.FreeType.Face) and #if constant(has_Image_TTF)
#if !constant(Image.FreeType.Face)
#if constant(has_Image_TTF)
#include <config.h>
- constant cvs_version = "$Id: ttf.pike,v 1.13 2002/02/06 12:32:23 jonasw Exp $";
+ constant cvs_version = "$Id: ttf.pike,v 1.14 2002/08/16 13:55:50 mattias Exp $";
constant name = "TTF fonts";
constant doc = "True Type font loader. Uses freetype to render text.";
152: Inside #if !constant(Image.FreeType.Face)
rr->setcolor( 0,0,0 );
if( fake_italic )
rr = rr->skewx( -(rr->ysize()/3) );
+ if( roxen->query("font_oversampling") )
return rr->scale(0.5);
-
+ else
+ return rr;
}
array text_extents( string what )
169: Inside #if !constant(Image.FreeType.Face)
fake_italic = fi;
real = r;
size = s;
+ if( roxen->query("font_oversampling") )
real->set_height( (int)(size*64/34.5) ); // aproximate to pixels
-
+ else
+ real->set_height( (int)(size*32/34.5) ); // aproximate to pixels
if(r_file_stat(fn+".properties"))
parse_html(lopen(fn+".properties","r")->read(), ([]),