--- parser3/src/classes/image.C 2001/09/01 14:47:11 1.37 +++ parser3/src/classes/image.C 2001/09/04 19:44:32 1.39 @@ -5,9 +5,9 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: image.C,v 1.37 2001/09/01 14:47:11 parser Exp $ + $Id: image.C,v 1.39 2001/09/04 19:44:32 parser Exp $ */ -static const char *RCSId="$Id: image.C,v 1.37 2001/09/01 14:47:11 parser Exp $"; +static const char *RCSId="$Id: image.C,v 1.39 2001/09/04 19:44:32 parser Exp $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -309,14 +309,17 @@ static void _html(Request& r, const Stri const Hash& fields=static_cast(r.self)->fields(); Hash *attribs=0; - if(params->size()) - if(attribs=params->get(0).get_hash()) { - Attrib_info attrib_info={&tag, 0}; - attribs->for_each(append_attrib_pair, &attrib_info); - } else - PTHROW(0, 0, - &method_name, - "attributes must be must be hash"); + if(params->size()) { + Value &vattribs=params->get(0); + if(vattribs.is_defined()) // allow 'void' + if(Hash *attribs=vattribs.get_hash()) { + Attrib_info attrib_info={&tag, 0}; + attribs->for_each(append_attrib_pair, &attrib_info); + } else + PTHROW(0, 0, + &method_name, + "attributes must be hash"); + } Attrib_info attrib_info={&tag, attribs}; fields.for_each(append_attrib_pair, &attrib_info); @@ -544,7 +547,7 @@ static void _polybar(Request& r, const S class Font : public Pooled { public: - const static int kerning; + const static int letter_spacing; int height; ///< Font heigth int monospace; ///< Default char width int spacebarspace; ///< spacebar width @@ -598,12 +601,12 @@ public: if(cstr) for(; *cstr; cstr++) { int index=index_of(*cstr); index_display(image, x, y, index); - x+=kerning + (monospace ? monospace : index_width(index)); + x+=letter_spacing + (monospace ? monospace : index_width(index)); } } }; -const int Font::kerning=1; +const int Font::letter_spacing=1; static void _font(Request& r, const String& method_name, MethodParams *params) { Pool& pool=r.pool();