6a78452000-09-04Per Hedbor #include <config.h>
6d8c522000-09-19Per Hedbor inherit "ttf";
425fc62000-09-21Per Hedbor constant cvs_version = "$Id: builtin.pike,v 1.4 2000/09/21 03:57:44 per Exp $";
6a78452000-09-04Per Hedbor  constant name = "Builtin fonts"; constant doc = "Fonts included in pike (and roxen)"; inherit FontHandler; array available_fonts() { return ({ "pike builtin", "roxen builtin" }); } array(mapping) font_information( string fnt ) { switch( replace(lower_case(fnt)," ","_")-"_" ) {
6d8c522000-09-19Per Hedbor  case "roxenbuiltin":
425fc62000-09-21Per Hedbor #if constant(__rbf)
6a78452000-09-04Per Hedbor  return ({ ([
6d8c522000-09-19Per Hedbor  "name":"roxen builtin", "family":"Roxen builtin font",
6a78452000-09-04Per Hedbor  "path":"-", "style":"normal",
6d8c522000-09-19Per Hedbor  "format":"scalable vector font",
6a78452000-09-04Per Hedbor  ]) });
6d8c522000-09-19Per Hedbor #endif case "pikebuiltin":
6a78452000-09-04Per Hedbor  return ({ ([
6d8c522000-09-19Per Hedbor  "name":"pike builtin", "family":"Pike builtin font",
6a78452000-09-04Per Hedbor  "path":"-", "style":"normal",
6d8c522000-09-19Per Hedbor  "format":"bitmap dump",
6a78452000-09-04Per Hedbor  ]) }); } } array has_font( string name, int size ) { switch( replace(lower_case(name)," ","_")-"_" ) { case "pikebuiltin": case "roxenbuiltin": return ({ "nn" }); } return 0; }
6d8c522000-09-19Per Hedbor object roxenbuiltin; #ifdef THREADS Thread.Mutex lock = Thread.Mutex(); #endif
6a78452000-09-04Per Hedbor  Font open( string name, int size, int bold, int italic ) { switch( replace(lower_case(name)," ","_")-"_" ) {
6d8c522000-09-19Per Hedbor  case "roxenbuiltin": #ifdef THREADS object lock = lock->lock(); #endif
425fc62000-09-21Per Hedbor #if constant(__rbf)
6d8c522000-09-19Per Hedbor  if( !roxenbuiltin )
425fc62000-09-21Per Hedbor  roxenbuiltin = grbf();
6d8c522000-09-19Per Hedbor  if( roxenbuiltin ) return TTFWrapper( roxenbuiltin(), size, "-" ); #endif
6a78452000-09-04Per Hedbor  case "pikebuiltin": return Image.Font(); } }