Roxen.git / server / font_handlers / old.pike

version» Context lines:

Roxen.git/server/font_handlers/old.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2000, Roxen IS.      #include <config.h> - constant cvs_version = "$Id: old.pike,v 1.9 2001/03/23 03:13:19 per Exp $"; + constant cvs_version = "$Id: old.pike,v 1.10 2001/05/04 14:26:14 jonasw Exp $";      constant name = "Compatibility bitmap fonts";   constant doc =   "Compatibility (bitmapped) fonts for Roxen 1.3 and earlier."   " Compact image file fonts are preferable to this format, since they are "   "almost always smaller, and easier to create.";      inherit FontHandler;      array available_fonts()
Roxen.git/server/font_handlers/old.pike:77:   }      string fix_name( string what )   {    return replace( lower_case(what), " ", "_" );   }      array has_font( string name, int size )   {    string base_dir; -  array available; +  array available, fallback_available;    if( String.width( name ) > 8 )    return 0;    foreach(roxen->query("font_dirs"), string dir)    {    base_dir = dir+size+"/"+fix_name(name); -  if((available = r_get_dir(base_dir))) break; +  if (available = r_get_dir(base_dir)) +  break; +  if (!fallback_available) {    base_dir=dir+"/32/"+fix_name(name); -  available = r_get_dir(base_dir); +  fallback_available = r_get_dir(base_dir);    } -  if(!available) return 0; -  return available - ({ "CVS" }); +     } -  +  if(!available && !fallback_available) return 0; +  return (available ? available : fallback_available) - ({ "CVS" }); + }      class MyFont {    inherit Image.Font;       void set_x_spacing(int|float delta) {    if(intp(delta))    ::set_x_spacing( (100.0+delta)/100.0 );    else    ::set_x_spacing( delta );    }