Branch: Tag:

2000-09-19

2000-09-19 12:20:41 by Per Hedbor <ph@opera.com>

Builtin roxen font added. Fixes [Bug 314 (#314)].

Rev: server/font_handlers/builtin.pike:1.3
Rev: server/font_handlers/rbf:1.1

1:   #include <config.h> - constant cvs_version = "$Id: builtin.pike,v 1.2 2000/09/19 10:30:45 nilsson Exp $"; + inherit "ttf"; + constant cvs_version = "$Id: builtin.pike,v 1.3 2000/09/19 12:20:40 per Exp $";      constant name = "Builtin fonts";   constant doc = "Fonts included in pike (and roxen)";
15:   {    switch( replace(lower_case(fnt)," ","_")-"_" )    { -  case "pikebuiltin": +  case "roxenbuiltin": + #if constant(has_Image_TTF)    return ({    ([ -  "name":"pike builtin", -  "family":"Pike builtin font", +  "name":"roxen builtin", +  "family":"Roxen builtin font",    "path":"-",    "style":"normal", -  "format":"bitmap dump", +  "format":"scalable vector font",    ])    }); -  case "roxenbuiltin": + #endif +  case "pikebuiltin":    return ({    ([ -  "name":"roxen builtin", -  "family":"Roxen builtin font", +  "name":"pike builtin", +  "family":"Pike builtin font",    "path":"-",    "style":"normal", -  "format":"scalable vector font", +  "format":"bitmap dump",    ])    });    }
48:    }    return 0;   } + object roxenbuiltin; + #ifdef THREADS + Thread.Mutex lock = Thread.Mutex(); + #endif      Font open( string name, int size, int bold, int italic )   {    switch( replace(lower_case(name)," ","_")-"_" )    { -  +  case "roxenbuiltin": + #ifdef THREADS +  object lock = lock->lock(); + #endif + #if constant(has_Image_TTF) && constant(Crypto.arcfour) && constant(Gz.inflate) +  if( !roxenbuiltin ) +  roxenbuiltin = compile_string( + Gz.inflate()->inflate(MIME.decode_base64( + #"eNpljzEOwjAMRfeewuqUSjQcAMGCBGKGPQqJA4E2QcaAAHF3Skshgj9Z38/2N0CruN6hYbBookVR + ZJ0L974AWLL1UV7IMyrnKxS5lMOzpiGtXT4A+JIvzW/SB1dpTpZ1Kid9Y0rXA0epybh4IlGUkyOy + wmBevtrjVUB+jt5+Ut0fOfxta2nRpSPU9h3OxcBqq4OtkI5txqLR6Dv9/tjBGBa13qBcrWbNweQp + SHGj2WwF1b9IyhDyiQK4j/UYZU+gUV5J" ) ))()->decode(); +  if( roxenbuiltin ) +  return TTFWrapper( roxenbuiltin(), size, "-" ); + #endif    case "pikebuiltin":    return Image.Font(); -  case "roxenbuiltin": -  return Image.Font(); // for now. Will use the cyberbit sans font +     }   }