Roxen.git
/
server
/
font_handlers
/
imagedir.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/font_handlers/imagedir.pike:1:
// This file is part of Roxen WebServer. // Copyright © 2000 - 2009, Roxen IS. #include <config.h> #include <stat.h>
-
constant cvs_version = "$Id: imagedir.pike,v 1.
16
2009
/
05
/
07
14
:
15
:
53
mast Exp $";
+
constant cvs_version = "$Id: imagedir.pike,v 1.
17
2011
/
12
/
28
18
:
29
:
37
mast 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:173:
]) )->finish(what); 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(roxen->query("font_dirs"), string dir)
{
+
dir = roxen_path (dir);
foreach( (get_dir( dir )||({})), string d ) if( Stdio.is_dir( dir+d ) ) { 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 ); }