Branch: Tag:

2000-09-04

2000-09-04 07:29:04 by Per Hedbor <ph@opera.com>

It's not really all that good an idea to add the styles to the 'name' attribute, since it won't really work to use that name as the name of the font to gtext et. al. Instead, I added a new 'style' member to the mapping '&_.name; &_.style;' is now hopefully always a valid font name.

Rev: server/base_server/fonts.pike:1.62
Rev: server/font_handlers/old.pike:1.5

2:   // Copyright © 1996 - 2000, Roxen IS.      #include <config.h> - constant cvs_version = "$Id: old.pike,v 1.4 2000/09/04 05:09:24 per Exp $"; + constant cvs_version = "$Id: old.pike,v 1.5 2000/09/04 07:29:04 per Exp $";      constant name = "Compatibility bitmap fonts";   constant doc = "Compatibility (bitmapped) fonts for Roxen 1.3 and earlier.";
40:      array(mapping) font_information( string fnt )   { +  string ofnt = fnt; +  fnt = replace(lower_case( fnt ), " ", "_");    array font_infos=({});    foreach(roxen->query("font_dirs"), string dir)    {
53:    if(has_value(d, style))    {    mapping font_info = ([ "name":fnt, -  "family":fnt, +  "family":ofnt,    "path":dir+fnt, -  +  "style":"",    "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; +  case 'l': font_info->style+="light"; break; +  case 'b': font_info->style+="bold"; break; +  case 'B': font_info->style+="black"; break;    } -  if(style[1]=='i') font_info->name+="italic"; +  if(style[1]=='i') font_info->style+="italic"; +  if(style[1]=='I') font_info->style+="oblique";    font_infos+=({ font_info });    }    }