Roxen.git
/
server
/
font_handlers
/
old.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/font_handlers/old.pike:1:
-
constant
cvs_version
=
"$Id:
old.pike,v
1.1
2000
/
09
/
03
02:33:01
per
Exp
$";
+
//
This
file
is
part
of Roxen WebServer
.
+
//
Copyright
©
1996
- 2000, Roxen IS.
-
+
#include <config.h>
+
constant cvs_version = "$Id: old.pike,v 1.2 2000/09/03 16:45:56 nilsson Exp $";
+
constant name = "Compatibility bitmap fonts"; constant doc = "Compatibility (bitmapped) fonts for Roxen 1.3 and earlier."; inherit FontHandler; array available_fonts() { array res = ({}); foreach(roxen->query("font_dirs"), string dir)
Roxen.git/server/font_handlers/old.pike:28:
res |= ({ replace(f,"_", " ") }); break; } } } } } return res; }
-
mapping font_information( string fnt )
+
array(
mapping
)
font_information( string fnt )
{
-
int
styles;
-
string path
_
found
;
+
array
font
_
infos=({})
;
foreach(roxen->query("font_dirs"), string dir) { dir+="32/"; if( r_file_stat( dir+fnt ) ) /* the font file exists in this dir.. */ { array d = r_get_dir(dir+fnt); foreach( ({ "nn", "ni", "li", "ln", "Bi", "Bn", "bi", "bn" }), string style) if(has_value(d, style)) {
-
path
_
found
= dir+fnt;
-
styles++
;
+
mapping font
_
info
=
([ "name":fnt,
+
"path":
dir+fnt
,
+
"styles":styles,
+
"format":"bitmap dump" ])
;
+
switch(style[0]) {
+
case 'l': font_info->name+="light"
;
break;
+
case 'b': font_info->name+="bold"; break;
+
case 'B': font_info->name+="black"; break;
}
-
+
if(style[1]=='i') font_info->name+="italic";
+
font_infos+=({ font_info });
} }
-
if(!styles) return 0;
-
return ([ "name":fnt,
-
"path":path_found,
-
"styles":styles,
-
"ttf":"no" ]);
+
}
-
+
return font_infos;
+
}
string fix_name( string what ) { return replace( lower_case(what), " ", "_" ); } array has_font( string name, int size ) { string base_dir; array available;