--- parser3/src/classes/image.C 2024/12/06 22:03:58 1.193 +++ parser3/src/classes/image.C 2025/05/26 00:52:15 1.196 @@ -26,7 +26,7 @@ #include "pa_table.h" #include "pa_charsets.h" -volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.193 2024/12/06 22:03:58 moko Exp $"; +volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.196 2025/05/26 00:52:15 moko Exp $"; // defines @@ -453,7 +453,7 @@ static Value* parse_IFD_entry_formatted_ HashStringValue& hash=result->hash(); for(uint i=0; iSX(), image->SY(), image); @@ -1347,12 +1347,12 @@ void Font::string_display(gdImage& image static void _font(Request& r, MethodParams& params) { - const String& alphabet=params.as_string(0, "alphabet must not be code"); + const String& alphabet=params.as_string(0, "alphabet must be string"); size_t alphabet_length=alphabet.length(r.charsets.source()); if(!alphabet_length) throw Exception(PARSER_RUNTIME, 0, "alphabet must not be empty"); - gdImage* image=load(r, params.as_string(1, FILE_NAME_MUST_BE_STRING)); + gdImage* image=load(r, params.as_file_name(1)); int spacebar_width=image->SX(); int monospace_width=0; // proportional @@ -1399,14 +1399,14 @@ static void _font(Request& r, MethodPara static void _text(Request& r, MethodParams& params) { int x=params.as_int(0, "x must be int", r); int y=params.as_int(1, "y must be int", r); - const String& s=params.as_string(2, "text must not be code"); + const String& s=params.as_string(2, "text must be string"); VImage& vimage=GET_SELF(r, VImage); vimage.font().string_display(vimage.image(), x, y, s); } static void _length(Request& r, MethodParams& params) { - const String& s=params.as_string(0, "text must not be code"); + const String& s=params.as_string(0, "text must be string"); VImage& vimage=GET_SELF(r, VImage); r.write(*new VInt(vimage.font().string_width(s)));